Skip to content

RallyRESTAPIError: the current Workspace |My Workspace| does not contain a Project that matches the current setting of the Project: None #91

Description

@noadmin

After creating Rally instance, project var is passed as None to the final request:

from pyral import Rally
apikey = 'my_API_key'
wsp = 'My Workspace'
prj = 'existed project in workspace'
rl = Rally('rally1.rallydev.com', apikey=api_key, workspace=wsp, project=prj)

----> 1 rl = Rally('rally1.rallydev.com', apikey=api_key, workspace=wsp, project=prj)

/home/developer/.virtualenvs/s3venv/lib/python2.7/site-packages/pyral/restapi.pyc in __init__(self, server, user, password, apikey, version, warn, server_ping, isolated_workspace, **kwargs)
    244         if 'project' in kwargs and kwargs['project'] and kwargs['project']!= 'default':
    245             proj = kwargs['project']
--> 246         self.contextHelper.check(self.server, wksp, proj, self.isolated_workspace)
    247 
    248         if self.contextHelper.currentContext() not in _rallyCache:

/home/developer/.virtualenvs/s3venv/lib/python2.7/site-packages/pyral/context.pyc in check(self, server, workspace, project, isolated_workspace)
    189             self._getSubscriptionWorkspaces(subscription, limit=0)
    190         self._getWorkspacesAndProjects(workspace=self._currentWorkspace, project=self._defaultProject)
--> 191         self._setOperatingContext(project)
    192         schema_info = self.agent.getSchemaInfo(self._currentWorkspace)
    193         processSchemaInfo(self.getWorkspace(), schema_info)

/home/developer/.virtualenvs/s3venv/lib/python2.7/site-packages/pyral/context.pyc in _setOperatingContext(self, project_name)
    294             a match in the returned set raise an Exception stating that fact.
    295         """
--> 296         result = self.agent.get('Project', fetch="Name", workspace=self._currentWorkspace)
    297 
    298         if not result or result.resultCount == 0:

/home/developer/.virtualenvs/s3venv/lib/python2.7/site-packages/pyral/restapi.pyc in get(self, entity, fetch, query, order, **kwargs)
    900                 projectScopeDown=True/False
    901         """
--> 902         context, resource, full_resource_url, limit = self._buildRequest(entity, fetch, query, order, kwargs)
    903 
    904         if self._log:

/home/developer/.virtualenvs/s3venv/lib/python2.7/site-packages/pyral/restapi.pyc in _buildRequest(self, entity, fetch, query, order, kwargs)
    796             context = RallyContext(self.server, self.user, self.password or self.apikey, self.service_url)
    797         else:
--> 798             context, augments = self.contextHelper.identifyContext(**kwargs)
    799             workspace_ref = self.contextHelper.currentWorkspaceRef()
    800             project_ref   = self.contextHelper.currentProjectRef()

/home/developer/.virtualenvs/s3venv/lib/python2.7/site-packages/pyral/context.pyc in identifyContext(self, **kwargs)
    716         if self._currentProject not in self._projects[self._currentWorkspace]:
    717             problem = "the current Workspace |%s| does not contain a Project that matches the current setting of the Project: %s" % (self._currentWorkspace, self._currentProject)
--> 718             raise RallyRESTAPIError(problem)
    719 ##
    720         return self.context, augments

RallyRESTAPIError: the current Workspace |My Workspace| does not contain a Project that matches the current setting of the Project: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions