From: Ed Bartosh Date: Mon, 11 Mar 2013 18:08:03 +0000 (+0200) Subject: Implemented support for project deletion in oscapi X-Git-Tag: 0.15~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=583f1f3052d7d2fac56bb9a5d345e2f37cb39919;p=tools%2Fgbs.git Implemented support for project deletion in oscapi One more feature for oscapi. This is also requried by backend services. Change-Id: Ia6210a294d132e1d4228962f059a95cc4a3283ac Signed-off-by: Ed Bartosh --- diff --git a/gitbuildsys/oscapi.py b/gitbuildsys/oscapi.py index 86f97d6..8de4fa3 100644 --- a/gitbuildsys/oscapi.py +++ b/gitbuildsys/oscapi.py @@ -165,6 +165,19 @@ class OSC(object): raise ObsError("can't copy config from %s to %s: %s" \ % (src, target, err)) + def delete_project(self, prj, force=False, msg=None): + """Delete OBS project.""" + query = {} + if force: + query['force'] = "1" + if msg: + query['comment'] = msg + url = core.makeurl(self.apiurl, ['source', prj], query) + try: + self.core_http(core.http_DELETE, url) + except OSCError, err: + raise ObsError("can't delete project %s: %s" % (prj, err)) + def exists(self, prj, pkg=''): """Check if project or package exists."""