@@ -125,40 +125,6 @@ def updatePage(self, spaceKey, pageId, pageTitle, pageText):
125125 self .throw_error (response )
126126 print "Success. Page %s has been updated.\n " % pageId
127127
128- def updateEnvironmentPage (self , spaceKey , pageTitles , environment , version , application ):
129- print "Executing updateEnvironmentPage() in ConfluenceClient\n "
130- pageID = self .getPageIdsByTitle (spaceKey , pageTitles )[0 ]
131- contentType = "application/json"
132- headers = {'Accept' : 'application/json' }
133- pageStr = ''
134- tmpPageStr = ''
135- bappend = True
136- bfound = False
137- for pageTitle in pageTitles :
138- searchByPageTitleUrl = '/rest/api/content/' + pageID + '?expand=body.storage'
139- response = self .httpRequest .get (searchByPageTitleUrl , contentType = contentType , headers = headers , quotePlus = True )
140- if response .getStatus () not in HTTP_SUCCESS :
141- self .throw_error (response )
142- result = json .loads (response .response )
143-
144- for page in result ['body' ]['storage' ]['value' ]:
145- if bappend :
146- pageStr = pageStr + page
147- if environment in pageStr and not bfound :
148- pageStr = pageStr + '</td><td>' + application + '</td><td>' + version + '</td>'
149- appendbool = False
150- bfound = True
151-
152- if not bappend and "</tr>" in tmpPageStr :
153- pageStr = pageStr + "</tr>"
154- appendbool = True
155-
156- if bfound :
157- tmpPageStr = tmpPageStr + page
158- print "********* HTML PAGE > " + pageStr
159- self .updatePage (spaceKey , pageID , pageTitles [0 ], pageStr )
160-
161-
162128 def throw_error (self , response ):
163129 print "Error from Confluence, HTTP Return: %s\n " % (response .getStatus ())
164130 print response .response
0 commit comments