mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Mass nuke deprecated items that are easily removed. ci_complete (#44320)
This commit is contained in:
parent
b7139782cf
commit
617372f8c0
18 changed files with 32 additions and 396 deletions
|
@ -204,12 +204,7 @@ class RoleDefinition(Base, Become, Conditional, Taggable):
|
|||
# other mechanism where we exclude certain kinds of field attributes,
|
||||
# or make this list more automatic in some way so we don't have to
|
||||
# remember to update it manually.
|
||||
if key not in base_attribute_names or key in ('connection', 'port', 'remote_user'):
|
||||
if key in ('connection', 'port', 'remote_user'):
|
||||
display.deprecated("Using '%s' as a role param has been deprecated. " % key +
|
||||
"In the future, these values should be entered in the `vars:` " +
|
||||
"section for roles, but for now we'll store it as both a param and an attribute.", version="2.7")
|
||||
role_def[key] = value
|
||||
if key not in base_attribute_names:
|
||||
# this key does not match a field attribute, so it must be a role param
|
||||
role_params[key] = value
|
||||
else:
|
||||
|
|
|
@ -53,7 +53,7 @@ class RoleInclude(RoleDefinition):
|
|||
raise AnsibleParserError("Invalid role definition: %s" % to_native(data))
|
||||
|
||||
if isinstance(data, string_types) and ',' in data:
|
||||
data = RoleRequirement.role_spec_parse(data)
|
||||
raise AnsibleError("Invalid old style role requirement: %s" % data)
|
||||
|
||||
ri = RoleInclude(play=play, role_basedir=current_role_path, variable_manager=variable_manager, loader=loader)
|
||||
return ri.load_data(data, variable_manager=variable_manager, loader=loader)
|
||||
|
|
|
@ -77,53 +77,6 @@ class RoleRequirement(RoleDefinition):
|
|||
trailing_path = trailing_path.split(',')[0]
|
||||
return trailing_path
|
||||
|
||||
@staticmethod
|
||||
def role_spec_parse(role_spec):
|
||||
# takes a repo and a version like
|
||||
# git+http://git.example.com/repos/repo.git,v1.0
|
||||
# and returns a list of properties such as:
|
||||
# {
|
||||
# 'scm': 'git',
|
||||
# 'src': 'http://git.example.com/repos/repo.git',
|
||||
# 'version': 'v1.0',
|
||||
# 'name': 'repo'
|
||||
# }
|
||||
display.deprecated("The comma separated role spec format, use the yaml/explicit format instead. Line that trigger this: %s" % role_spec,
|
||||
version="2.7")
|
||||
|
||||
default_role_versions = dict(git='master', hg='tip')
|
||||
|
||||
role_spec = role_spec.strip()
|
||||
role_version = ''
|
||||
if role_spec == "" or role_spec.startswith("#"):
|
||||
return (None, None, None, None)
|
||||
|
||||
tokens = [s.strip() for s in role_spec.split(',')]
|
||||
|
||||
# assume https://github.com URLs are git+https:// URLs and not
|
||||
# tarballs unless they end in '.zip'
|
||||
if 'github.com/' in tokens[0] and not tokens[0].startswith("git+") and not tokens[0].endswith('.tar.gz'):
|
||||
tokens[0] = 'git+' + tokens[0]
|
||||
|
||||
if '+' in tokens[0]:
|
||||
(scm, role_url) = tokens[0].split('+')
|
||||
else:
|
||||
scm = None
|
||||
role_url = tokens[0]
|
||||
|
||||
if len(tokens) >= 2:
|
||||
role_version = tokens[1]
|
||||
|
||||
if len(tokens) == 3:
|
||||
role_name = tokens[2]
|
||||
else:
|
||||
role_name = RoleRequirement.repo_url_to_role_name(tokens[0])
|
||||
|
||||
if scm and not role_version:
|
||||
role_version = default_role_versions.get(scm, '')
|
||||
|
||||
return dict(scm=scm, src=role_url, version=role_version, name=role_name)
|
||||
|
||||
@staticmethod
|
||||
def role_yaml_parse(role):
|
||||
|
||||
|
@ -152,8 +105,7 @@ class RoleRequirement(RoleDefinition):
|
|||
if 'role' in role:
|
||||
name = role['role']
|
||||
if ',' in name:
|
||||
# Old style: {role: "galaxy.role,version,name", other_vars: "here" }
|
||||
role = RoleRequirement.role_spec_parse(role['role'])
|
||||
raise AnsibleError("Invalid old style role requirement: %s" % name)
|
||||
else:
|
||||
del role['role']
|
||||
role['name'] = name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue