- def _init_ctx(self, username=None, project=None):
- if username and project:
- self.access_key = "%s:%s" % (username, project)
- self.secret_key = self.nova_shell.auth_manager.get_user(username).secret
+ def init_context(self, project_name=None):
+
+ # use the context of the specified project's project
+ # manager.
+ if project_name:
+ project = self.nova_shell.auth_manager.get_project(project_name)
+ self.access_key = "%s:%s" % (
+ project.project_manager.name, project_name)
+ self.secret_key = project.project_manager.secret