# Buggy code
def execute_info(self):
    """
    Executes the info action. This action prints out detailed
    information about an installed role as well as info available
    from the galaxy API.
    """

    if len(self.args) == 0:
        # the user needs to specify a role
        raise AnsibleOptionsError("- you must specify a user/role name")

    roles_path = self.get_opt("roles_path")

    data = ""
    for role in self.args:
        role_info = {}
        gr = GalaxyRole(self.galaxy, role)
        # self.galaxy.add_role(gr)

        install_info = gr.install_info
        if install_info:
            if "version" in install_info:
                install_info["intalled_version"] = install_info["version"]
                del install_info["version"]
            role_info.update(install_info)

        remote_data = False
        if self.api:
            remote_data = self.api.lookup_role_by_name(role, False)

        if remote_data:
            role_info.update(remote_data)

        if gr.metadata:
            role_info.update(gr.metadata)

        req = RoleRequirement()
        __, __, role_spec = req.parse({"role": role})
        if role_spec:
            role_info.update(role_spec)

        data += self._display_role_info(role_info)
        if not data:
            data += "\n- the role %s was not found" % role

    self.pager(data)


# Traceback (NameError)
Unexpected Exception: global name 'scm_archive_role' is not defined
the full traceback was:

Traceback (most recent call last):
File "/Users/guido/ansible/bin/ansible-galaxy", line 79, in <module>
sys.exit(cli.run())
File "/Users/guido/ansible/lib/ansible/cli/galaxy.py", line 136, in run
self.execute()
File "/Users/guido/ansible/lib/ansible/cli/__init__.py", line 97, in execute
fn()
File "/Users/guido/ansible/lib/ansible/cli/galaxy.py", line 369, in execute_install
tmp_file = scm_archive_role(role.scm, role.src, role.version, role.name)
NameError: global name 'scm_archive_role' is not defined

# Fixed code
def execute_info(self):
    """
    Executes the info action. This action prints out detailed
    information about an installed role as well as info available
    from the galaxy API.
    """

    if len(self.args) == 0:
        # the user needs to specify a role
        raise AnsibleOptionsError("- you must specify a user/role name")

    roles_path = self.get_opt("roles_path")

    data = ""
    for role in self.args:
        role_info = {"role_path": roles_path}
        gr = GalaxyRole(self.galaxy, role)

        install_info = gr.install_info
        if install_info:
            if "version" in install_info:
                install_info["intalled_version"] = install_info["version"]
                del install_info["version"]
            role_info.update(install_info)

        remote_data = False
        if self.api:
            remote_data = self.api.lookup_role_by_name(role, False)

        if remote_data:
            role_info.update(remote_data)

        if gr.metadata:
            role_info.update(gr.metadata)

        req = RoleRequirement()
        __, __, role_spec = req.parse({"role": role})
        if role_spec:
            role_info.update(role_spec)

        data += self._display_role_info(role_info)
        if not data:
            data += "\n- the role %s was not found" % role

    self.pager(data)