@@ -573,7 +573,6 @@ def getAllUsers(self, workspace=None):
573573 # and other UserProfile attributes
574574 ]
575575
576- #users_resource = 'users?fetch=true&query=&pagesize=%s&start=1&workspace=%s' % (MAX_PAGESIZE, workspace_ref)
577576 users_resource = 'users?fetch=%s&query=&pagesize=%s&start=1&workspace=%s' % ("," .join (user_attrs ), MAX_PAGESIZE , workspace_ref )
578577 full_resource_url = '%s/%s' % (self .service_url , users_resource )
579578 response = self .session .get (full_resource_url , timeout = SERVICE_REQUEST_TIMEOUT )
@@ -704,7 +703,6 @@ def _itemQuery(self, entityName, oid, workspace=None, project=None):
704703 raise RallyRESTAPIError ('%s %s' % (response .status_code , problem ))
705704
706705 response = RallyRESTResponse (self .session , context , '%s.x' % entityName , response , "full" , 1 )
707- #item = six.next(response)
708706 item = response .next ()
709707 return item # return back an instance representing the item
710708
@@ -911,7 +909,6 @@ def get(self, entity, fetch=False, query=None, order=None, **kwargs):
911909 response = self ._getRequestResponse (context , full_resource_url , limit )
912910
913911 if kwargs and 'instance' in kwargs and kwargs ['instance' ] == True and response .resultCount == 1 :
914- #return six.next(response)
915912 return response .next ()
916913 return response
917914
@@ -1032,7 +1029,6 @@ def post(self, entityName, itemData, workspace='current', project='current', **k
10321029 if response .status_code != HTTP_REQUEST_SUCCESS_CODE or response .resultCount == 0 :
10331030 raise RallyRESTAPIError ('Target %s %s could not be located' % (entityName , formattedID ))
10341031
1035- #target = six.next(response)
10361032 target = response .next ()
10371033 oid = target .ObjectID
10381034 itemData ['ObjectID' ] = oid
@@ -1087,7 +1083,6 @@ def delete(self, entityName, itemIdent, workspace='current', project='current',
10871083 if response .status_code != HTTP_REQUEST_SUCCESS_CODE :
10881084 raise RallyRESTAPIError ('Target %s %s could not be located' % (entityName , itemIdent ))
10891085
1090- #target = six.next(response)
10911086 target = response .next ()
10921087 objectID = target .ObjectID
10931088##
@@ -1458,7 +1453,6 @@ def addAttachment(self, artifact, filename, mime_type='text/plain'):
14581453
14591454 response = self .get ('Attachment' , fetch = True , query = 'Name = "%s"' % attachment_file_name )
14601455 if response .resultCount :
1461- #attachment = six.next(response)
14621456 attachment = response .next ()
14631457 already_attached = [att for att in current_attachments if att .oid == attachment .oid ]
14641458 if already_attached :
@@ -1560,7 +1554,6 @@ def getAttachment(self, artifact, filename):
15601554 response = RallyRESTResponse (self .session , context , "AttachmentContent.x" , resp , "full" , 1 )
15611555 if response .errors or response .resultCount != 1 :
15621556 return None
1563- #att_content = six.next(response)
15641557 att_content = response .next ()
15651558 att .Content = base64 .decodestring (att_content .Content ) # maybe further txfm to Unicode ?
15661559 return att
@@ -1604,9 +1597,6 @@ def deleteAttachment(self, artifact, filename):
16041597
16051598 # get the target Attachment and the associated AttachmentContent item
16061599 attachment = hits .pop (0 )
1607- ##
1608- ## print(attachment.details())
1609- ##
16101600 if attachment .Content and attachment .Content .oid :
16111601 success = self .delete ('AttachmentContent' , attachment .Content .oid , project = None )
16121602 if not success :
@@ -1651,7 +1641,6 @@ def _realizeArtifact(self, artifact):
16511641 art_type = self .ARTIFACT_TYPE [prefix ]
16521642 response = self .get (art_type , fetch = True , query = 'FormattedID = %s' % artifact )
16531643 if response .resultCount == 1 :
1654- #artifact = six.next(response)
16551644 artifact = response .next ()
16561645 else :
16571646 art_type = False
@@ -1730,7 +1719,6 @@ def _postRankRequest(self, target_artifact, resource, update_item):
17301719 workspace_ref = self .contextHelper .currentWorkspaceRef ()
17311720 auth_token = self .obtainSecurityToken ()
17321721 full_resource_url = "%s/%s&workspace=%s&key=%s" % (self .service_url , resource , workspace_ref , auth_token )
1733- #print("rank%s full_resource_url: %s" % (direction, full_resource_url))
17341722 payload = json .dumps (update_item )
17351723 response = self .session .post (full_resource_url , data = payload , headers = RALLY_REST_HEADERS )
17361724 context = self .contextHelper .currentContext ()
0 commit comments