Project Cleanup
This commit is contained in:
parent
2a7cc03d58
commit
55104a5538
6
main.py
6
main.py
|
@ -7,6 +7,7 @@ import myOpenstackApp
|
|||
testProjectName="SmokeTest"
|
||||
testProjectExists=False
|
||||
testProject=""
|
||||
cleanupResourcesOnCompletion=True
|
||||
|
||||
y=myOpenstackApp.OSC
|
||||
y.initalise()
|
||||
|
@ -41,8 +42,8 @@ else:
|
|||
|
||||
|
||||
def cleanUp():
|
||||
log.info["Cleaning up"]
|
||||
log.info["Deleting project"]
|
||||
log.info("Cleaning up")
|
||||
log.info("Deleting project")
|
||||
y.ks.deleteProject(testProject['id'])
|
||||
#Delete VM
|
||||
#Delete router
|
||||
|
@ -51,4 +52,5 @@ def cleanUp():
|
|||
pass
|
||||
|
||||
|
||||
if cleanupResourcesOnCompletion:
|
||||
cleanUp()
|
||||
|
|
|
@ -67,6 +67,8 @@ class OpenStackConnection_x:
|
|||
response = requests.get(url, headers=headers)
|
||||
elif getPost=="POST":
|
||||
response = requests.post(url, data=data_json, headers=headers)
|
||||
elif getPost=="DELETE":
|
||||
response = requests.delete(url, headers=headers)
|
||||
else:
|
||||
raise ValueError("Unknown request type")
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -82,5 +82,5 @@ class myopenstack_keystone():
|
|||
log.info("Deleting a project")
|
||||
|
||||
_self.newProjectData=_self.connection.make_request("DELETE", "projects/"+id, "",
|
||||
os.getenv("OS_AUTH_URL")).json()
|
||||
os.getenv("OS_AUTH_URL"))
|
||||
return _self.newProjectData
|
Loading…
Reference in New Issue