ugly way to fix the project removing problem
authorHasan Wan <hasan.wan@intel.com>
Tue, 26 Feb 2013 02:53:40 +0000 (10:53 +0800)
committerHasan Wan <hasan.wan@intel.com>
Wed, 6 Mar 2013 06:31:33 +0000 (14:31 +0800)
Change-Id: Idf8f2e55c043723d2bcdd16fd56dc59f1a4c354f
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
common/tempbuildpkg.py

index 90524a1..1af2398 100644 (file)
@@ -10,7 +10,10 @@ from xml.etree import cElementTree as ET
 
 class BuildService2(BuildService):
     def __init__(self, apiurl, apiuser, apipasswd):
-       BuildService.__init__(self, apiurl, apiuser, apipasswd)
+        BuildService.__init__(self, apiurl, apiuser, apipasswd)
+        self.apiurl = apiurl
+        self.apiuser = apiuser
+        self.apipasswd = apipasswd
 
     def update_meta(self, project, metaconf):
         """
@@ -21,6 +24,13 @@ class BuildService2(BuildService):
 
         core.http_PUT(meta_url, file=metaconf)
 
+    def deleteProject(self, project):
+        """ overwirte core deleteproject method, due to it always not work """
+        u = core. makeurl(self.apiurl, ['source', project])
+        os.system('curl -X DELETE %s -k --user %s:%s '%(u,
+                                                        self.apiuser,
+                                                        self.apipasswd))
+
     def get_meta(self, project):
         """
         update meta configuration for project
@@ -255,4 +265,3 @@ class TempBuildService():
 
         os.close(fileh)
         os.unlink(filename)
-