Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(12)  |  Derive(0)  |  Import(0)

src/p/y/python-saharaclient-0.7.0/saharaclient/shell.py   python-saharaclient(Download)
            if not auth_plugin or not auth_plugin.opts:
                if not os_username:
                    raise exc.CommandError("You must provide a username "
                                           "via either --os-username or "
                                           "env[OS_USERNAME]")
 
            if not os_tenant_name and not os_tenant_id:
                raise exc.CommandError("You must provide a tenant name "
 
            if not os_auth_url:
                    raise exc.CommandError("You must provide an auth url "
                                           "via either --os-auth-url or "
                                           "env[OS_AUTH_URL] or specify an "
                if not os_password:
                    raise exc.CommandError(
                        'Expecting a password provided via either '
                        '--os-password, env[OS_PASSWORD], or '
                        'prompted response')
                self.subcommands[args.command].print_help()
            else:
                raise exc.CommandError("'%s' is not a valid subcommand" %
                                       args.command)
        else:

src/p/y/python-saharaclient-0.7.0/saharaclient/api/shell.py   python-saharaclient(Download)
def _get_by_id_or_name(manager, id=None, name=None):
    if not (name or id):
        raise exceptions.CommandError("either NAME or ID is required")
    if id:
        return manager.get(id)
    ls = manager.find(name=name)
    if len(ls) == 0:
        raise exceptions.CommandError("%s '%s' not found" %
                                       name))
    elif len(ls) > 1:
        raise exceptions.CommandError("%s '%s' not unique, try by ID" %
                                      (manager.resource_class.resource_name,
                                       name))

src/p/y/python-saharaclient-0.7.0/saharaclient/openstack/common/cliutils.py   python-saharaclient(Download)
                    "name_or_id": name_or_id
                }
            raise exceptions.CommandError(msg)
    except exceptions.NoUniqueMatch:
        msg = _("Multiple %(name)s matches found for "
                "name_or_id": name_or_id
            }
        raise exceptions.CommandError(msg)
 
 

src/p/y/python-saharaclient-0.7.0/saharaclient/nova/utils.py   python-saharaclient(Download)
            msg = "No %s with a name or ID of '%s' exists." % \
                (manager.resource_class.__name__.lower(), name_or_id)
            raise exceptions.CommandError(msg)
    except exceptions.NoUniqueMatch:
        msg = ("Multiple %s matches found for '%s', use an ID to be more"
               " specific." % (manager.resource_class.__name__.lower(),
                               name_or_id))
        raise exceptions.CommandError(msg)