예제 #1
0
    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")
예제 #2
0
 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"]))
예제 #3
0
 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"]))
예제 #4
0
파일: verify.py 프로젝트: Projoke/rally
 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)
예제 #5
0
    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")
예제 #6
0
파일: task.py 프로젝트: esikachev/rally
    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)
예제 #7
0
파일: verify.py 프로젝트: ePlusPS/gbp-rally
    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)
예제 #8
0
파일: verify.py 프로젝트: rvbaz/rally
    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)
예제 #9
0
    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)
예제 #10
0
    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)
예제 #11
0
파일: task.py 프로젝트: hmdesai89/rally
    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)
예제 #12
0
파일: task.py 프로젝트: esikachev/rally
    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)
예제 #13
0
    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)
예제 #14
0
    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"])
예제 #15
0
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)
예제 #16
0
파일: profile.py 프로젝트: huikang/rally
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)    
예제 #17
0
    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
예제 #18
0
    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
예제 #19
0
    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
예제 #20
0
    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
예제 #21
0
파일: env.py 프로젝트: jacobwagner/rally
 def _use(self, env_uuid, to_json):
     _print("Using environment: %s" % env_uuid, to_json)
     fileutils.update_globals_file(envutils.ENV_ENV, env_uuid)
예제 #22
0
파일: task.py 프로젝트: jacobwagner/rally
    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)
예제 #23
0
파일: env.py 프로젝트: tuniu1985/rally-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)
예제 #24
0
    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)