[Et-mgmt-commits-list] [SCM] virt-factory branch, master now at v0.0.3-189-g815c61e

Adrian Likins alikins at redhat.com
Thu Aug 23 18:53:47 UTC 2007


Hello,

This is an automated email from the git hooks/update script, it was
generated because a ref change was pushed to the repository.

Updating branch, master,
       via  815c61e67daeb6a787723bd7cae2532f21eaee48 (commit)
      from  2904fda452658e2dc3c1d66a1d0732c4fe1cf75c (commit)

- Log -----------------------------------------------------------------
commit 815c61e67daeb6a787723bd7cae2532f21eaee48
Author: Adrian Likins <alikins at grimlock.devel.redhat.com>
Date:   Thu Aug 23 14:45:20 2007 -0400

    add support for deleting tasks
    
    test task listing in test-it-all
-----------------------------------------------------------------------

Diffstat:
 ampm/command_modules/delete.py |   61 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/ampm/command_modules/delete.py b/ampm/command_modules/delete.py
new file mode 100644
index 0000000..7baddc2
--- /dev/null
+++ b/ampm/command_modules/delete.py
@@ -0,0 +1,61 @@
+#!/usr/bin/python
+
+import getopt
+import os
+import pprint
+
+from rhpl.translate import _, N_, textdomain, utf8
+
+from client import ampmlib
+
+def run(args):
+    command = Delete(args)
+
+
+class Delete(object):
+    def __init__(self, args, api=None):
+        self.api = ampmlib.Api(url="http://127.0.0.1:5150",
+                               username="admin",
+                               password="fedora")
+        if api:
+            self.api = api
+        self.verbose = 0
+        self.__parse_args(args)
+
+    
+    def __parse_args(self, args):
+
+        task_id = None
+        profile = None
+        
+        try:
+            opts, args = getopt.getopt(args, "hvm",
+                                       ["help",
+                                        "verbose",
+                                        "task_id=",
+                                        "profile="])
+        except getopt.error, e:
+            print _("Error parsing list arguments: %s") % e
+            # FIXME: error handling
+
+
+        for (opt, val) in opts:
+            if opt in ["-h", "--help"]:
+                print_help()
+            if opt in ["-v", "--verbose"]:
+                self.verbose = self.verbose + 1
+            if opt in ["--task_id"]:
+                task_id = val
+            if opt in ["--profile"]:
+                profile = val
+
+        if task_id is not None:
+            self.delete_task(task_id)
+
+    def delete_task(self, task_id=None):
+        (retcode, data) = self.api.task_delete(task_id)
+        if self.verbose > 2:
+            pprint.pprint(data)
+
+            
+        

hooks/update
---
Git Source Code Management System
hooks/update refs/heads/master \
  2904fda452658e2dc3c1d66a1d0732c4fe1cf75c \
  815c61e67daeb6a787723bd7cae2532f21eaee48




More information about the Et-mgmt-commits-list mailing list