diff options
author | Jordan Borean <jborean93@gmail.com> | 2019-09-05 11:46:44 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-05 11:46:44 +1000 |
commit | 3a7b77a94ce534c502828ebd2959f6fdf9d183f5 (patch) | |
tree | e66c4f0c61bad9119cccca4c6f281c4be032c11f /lib/ansible/cli | |
parent | f81b7dd10a674c72659b25be20461865bb997eed (diff) | |
download | ansible-3a7b77a94ce534c502828ebd2959f6fdf9d183f5.tar.gz |
ansible-galaxy fix --server option for roles (#61820)
Diffstat (limited to 'lib/ansible/cli')
-rw-r--r-- | lib/ansible/cli/galaxy.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index 12136fde27..b8af7430a5 100644 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -405,7 +405,7 @@ class GalaxyCLI(CLI): display.vvv("found role %s in yaml file" % to_text(role)) if "name" not in role and "src" not in role: raise AnsibleError("Must specify name or src for role") - return [GalaxyRole(self.galaxy, **role)] + return [GalaxyRole(self.galaxy, self.api, **role)] else: b_include_path = to_bytes(requirement["include"], errors="surrogate_or_strict") if not os.path.isfile(b_include_path): @@ -414,7 +414,7 @@ class GalaxyCLI(CLI): with open(b_include_path, 'rb') as f_include: try: - return [GalaxyRole(self.galaxy, **r) for r in + return [GalaxyRole(self.galaxy, self.api, **r) for r in (RoleRequirement.role_yaml_parse(i) for i in yaml.safe_load(f_include))] except Exception as e: raise AnsibleError("Unable to load data from include requirements file: %s %s" @@ -722,7 +722,7 @@ class GalaxyCLI(CLI): for role in context.CLIARGS['args']: role_info = {'path': roles_path} - gr = GalaxyRole(self.galaxy, role) + gr = GalaxyRole(self.galaxy, self.api, role) install_info = gr.install_info if install_info: @@ -827,7 +827,7 @@ class GalaxyCLI(CLI): # (and their dependencies, unless the user doesn't want us to). for rname in context.CLIARGS['args']: role = RoleRequirement.role_yaml_parse(rname.strip()) - roles_left.append(GalaxyRole(self.galaxy, **role)) + roles_left.append(GalaxyRole(self.galaxy, self.api, **role)) for role in roles_left: # only process roles in roles files when names matches if given @@ -871,7 +871,7 @@ class GalaxyCLI(CLI): display.debug('Installing dep %s' % dep) dep_req = RoleRequirement() dep_info = dep_req.role_yaml_parse(dep) - dep_role = GalaxyRole(self.galaxy, **dep_info) + dep_role = GalaxyRole(self.galaxy, self.api, **dep_info) if '.' not in dep_role.name and '.' not in dep_role.src and dep_role.scm is None: # we know we can skip this, as it's not going to # be found on galaxy.ansible.com @@ -913,7 +913,7 @@ class GalaxyCLI(CLI): raise AnsibleOptionsError('- you must specify at least one role to remove.') for role_name in context.CLIARGS['args']: - role = GalaxyRole(self.galaxy, role_name) + role = GalaxyRole(self.galaxy, self.api, role_name) try: if role.remove(): display.display('- successfully removed %s' % role_name) @@ -941,7 +941,7 @@ class GalaxyCLI(CLI): if context.CLIARGS['role']: # show the requested role, if it exists name = context.CLIARGS['role'] - gr = GalaxyRole(self.galaxy, name) + gr = GalaxyRole(self.galaxy, self.api, name) if gr.metadata: display.display('# %s' % os.path.dirname(gr.path)) _display_role(gr) @@ -964,7 +964,7 @@ class GalaxyCLI(CLI): path_files = os.listdir(role_path) path_found = True for path_file in path_files: - gr = GalaxyRole(self.galaxy, path_file, path=path) + gr = GalaxyRole(self.galaxy, self.api, path_file, path=path) if gr.metadata: _display_role(gr) for w in warnings: |