def use(self, api, deployment): """Set active deployment. :param deployment: UUID or name of the deployment """ # TODO(astudenov): make this method platform independent try: if not isinstance(deployment, dict): deployment = api.deployment.get(deployment=deployment) except exceptions.DeploymentNotFound: print("Deployment %s is not found." % deployment) return 1 print("Using deployment: %s" % deployment["uuid"]) fileutils.update_globals_file("RALLY_DEPLOYMENT", deployment["uuid"]) if "openstack" in deployment["credentials"]: creds = deployment["credentials"]["openstack"][0] self._update_openrc_deployment_file( deployment["uuid"], creds["admin"] or creds["users"][0]) print("~/.rally/openrc was updated\n\nHINTS:\n" "\n* To use standard OpenStack clients, set up your env by " "running:\n\tsource ~/.rally/openrc\n" " OpenStack clients are now configured, e.g run:\n\t" "openstack image list")
def use_verifier(self, api, verifier_id): """Choose a verifier to use for the future operations.""" verifier = api.verifier.get(verifier_id=verifier_id) fileutils.update_globals_file(envutils.ENV_VERIFIER, verifier["uuid"]) print("Using verifier '%s' (UUID=%s) as the default verifier " "for the future CLI operations." % (verifier["name"], verifier["uuid"]))
def use(self, api, verification_uuid): """Choose a verification to use for the future operations.""" verification = api.verification.get(verification_uuid) fileutils.update_globals_file( envutils.ENV_VERIFICATION, verification.uuid) print(_("Using verification (UUID=%s) as the default verification " "for the future operations.") % verification.uuid)
def use(self, api, deployment): """Set active deployment.""" # TODO(astudenov): make this method platform independent try: if not isinstance(deployment, dict): deployment = api.deployment.get(deployment=deployment) except exceptions.DBRecordNotFound: print("Deployment %s is not found." % deployment) return 1 print("Using deployment: %s" % deployment["uuid"]) fileutils.update_globals_file(envutils.ENV_DEPLOYMENT, deployment["uuid"]) fileutils.update_globals_file(envutils.ENV_ENV, deployment["uuid"]) if "openstack" in deployment["credentials"]: creds = deployment["credentials"]["openstack"][0] self._update_openrc_deployment_file( deployment["uuid"], creds["admin"] or creds["users"][0]) print("~/.rally/openrc was updated\n\nHINTS:\n" "\n* To use standard OpenStack clients, set up your env by " "running:\n\tsource ~/.rally/openrc\n" " OpenStack clients are now configured, e.g run:\n\t" "openstack image list")
def use(self, task): """Set active task. Alias for "rally use task". :param task: Task uuid. """ print("Using task: %s" % task) db.task_get(task) fileutils.update_globals_file("RALLY_TASK", task)
def use(self, verification): """Set active verification. Alias for "rally use verification" :param verification: a UUID of verification """ print("Verification UUID: %s" % verification) db.verification_get(verification) fileutils.update_globals_file("RALLY_VERIFICATION", verification)
def use(self, verification): """Set active verification. :param verification: a UUID of verification """ print("Verification UUID: %s" % verification) api.Verification.get(verification) fileutils.update_globals_file("RALLY_VERIFICATION", verification)
def use(self, verification): """Set active verification. :param verification: UUID of a verification """ print(_("Verification UUID: %s") % verification) api.Verification.get(verification) fileutils.update_globals_file("RALLY_VERIFICATION", verification)
def use(self, verification): """Set active verification. :param verification: a UUID of verification """ print("Verification UUID: %s" % verification) objects.Verification.get(verification) fileutils.update_globals_file("RALLY_VERIFICATION", verification)
def use(self, task_id): """Set active task. :param task_id: Task uuid. """ print("Using task: %s" % task_id) api.Task.get(task_id) fileutils.update_globals_file("RALLY_TASK", task_id)
def use(self, api, verification_uuid): """Choose a verification to use for the future operations.""" verification = api.verification.get( verification_uuid=verification_uuid) fileutils.update_globals_file( envutils.ENV_VERIFICATION, verification["uuid"]) print("Using verification (UUID=%s) as the default verification " "for the future operations." % verification["uuid"])
def setup(): if CONF.profile: profile = CONF.profile else: profile = envutils.get_global("RALLY_PROFILE") if profile == None: profile = PROFILE_OPENSTACK if not profile in PROFILE_ALL_LIST: raise InvalidArgumentsException("Unknown profile %s" % profile) fileutils.update_globals_file("RALLY_PROFILE", profile) print("Using profile: %s" % profile)
def use(self, deployment): """Set active deployment. :param deployment: UUID or name of the deployment """ try: deployment = api.Deployment.get(deployment) print("Using deployment: %s" % deployment["uuid"]) fileutils.update_globals_file("RALLY_DEPLOYMENT", deployment["uuid"]) except exceptions.DeploymentNotFound: print("Deployment %s is not found." % deployment) return 1
def use(self, deployment): """Set active deployment. Alias for "rally use deployment". :param deployment: UUID or name of a deployment """ try: deployment = db.deployment_get(deployment) print("Using deployment: %s" % deployment["uuid"]) fileutils.update_globals_file("RALLY_DEPLOYMENT", deployment["uuid"]) self._update_openrc_deployment_file( deployment["uuid"], deployment.get("admin") or deployment.get("users")[0]) print("~/.rally/openrc was updated\n\nHINTS:\n" "* To get your cloud resources, run:\n\t" "rally show [flavors|images|keypairs|networks|secgroups]\n" "\n* To use standard OpenStack clients, set up your env by " "running:\n\tsource ~/.rally/openrc\n" " OpenStack clients are now configured, e.g run:\n\t" "glance image-list") except exceptions.DeploymentNotFound: print("Deployment %s is not found." % deployment) return 1
def use(self, deployment): """Set active deployment. Alias for "rally use deployment". :param deployment: UUID or name of a deployment """ try: deployment = db.deployment_get(deployment) print("Using deployment: %s" % deployment["uuid"]) fileutils.update_globals_file("RALLY_DEPLOYMENT", deployment["uuid"]) self._update_openrc_deployment_file( deployment["uuid"], deployment.get("admin") or deployment.get("users")[0]) print ("~/.rally/openrc was updated\n\nHINTS:\n" "* To get your cloud resources, run:\n\t" "rally show [flavors|images|keypairs|networks|secgroups]\n" "\n* To use standard OpenStack clients, set up your env by " "running:\n\tsource ~/.rally/openrc\n" " OpenStack clients are now configured, e.g run:\n\t" "glance image-list") except exceptions.DeploymentNotFound: print("Deployment %s is not found." % deployment) return 1
def _use(self, env_uuid, to_json): _print("Using environment: %s" % env_uuid, to_json) fileutils.update_globals_file(envutils.ENV_ENV, env_uuid)
def use(self, api, task_id): """Set active task.""" print("Using task: %s" % task_id) api.task.get(task_id=task_id) fileutils.update_globals_file("RALLY_TASK", task_id)