You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2014/10/31 10:34:13 UTC

[1/3] git commit: printer: fix color printer rules to accommodate json output

Repository: cloudstack-cloudmonkey
Updated Branches:
  refs/heads/master b20b59c16 -> 088001e7a


printer: fix color printer rules to accommodate json output

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/commit/fd327460
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/fd327460
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/fd327460

Branch: refs/heads/master
Commit: fd327460343a375f9ddfc6e04d8aab5c107caabc
Parents: b20b59c
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Oct 31 14:58:44 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Oct 31 14:58:44 2014 +0530

----------------------------------------------------------------------
 cloudmonkey/printer.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/fd327460/cloudmonkey/printer.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/printer.py b/cloudmonkey/printer.py
index e548d2c..29d5903 100644
--- a/cloudmonkey/printer.py
+++ b/cloudmonkey/printer.py
@@ -50,12 +50,12 @@ def get_colorscheme():
 
 
 class MonkeyLexer(RegexLexer):
-    keywords = ['[a-z]*id', '^[a-z A-Z]*:']
+    keywords = ['[a-z]*id', '"[a-z]*id"', '^[a-z A-Z]*:']
     attributes = ['[Tt]rue', '[Ff]alse']
     params = ['[a-z]*[Nn]ame', 'type', '[Ss]tate']
 
     uuid_rgx = r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
-    date_rgx = r'[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:]{8}-[0-9]{4}'
+    date_rgx = r'[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:]{8}[0-9+]{5}'
 
     def makelistre(lis):
         return r'(' + r'|'.join(lis) + r')'
@@ -64,7 +64,9 @@ class MonkeyLexer(RegexLexer):
         'root': [
             (r' ', Whitespace),
             (date_rgx, Number),
+            (r'"' + date_rgx + r'"', Number),
             (uuid_rgx, Literal),
+            (r'"' + uuid_rgx + r'"', Literal),
             (r'(?:\b\d+\b(?:-\b\d+|%)?)', Number),
             (r'^[-=]*\n', Operator.Word),
             (r'Error', Error),


[3/3] git commit: cloudmonkey: duplicate filter break output, print using unique ones

Posted by bh...@apache.org.
cloudmonkey: duplicate filter break output, print using unique ones

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/commit/088001e7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/088001e7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/088001e7

Branch: refs/heads/master
Commit: 088001e7acabb2e2c16a18f2ade84b500c8b5bb6
Parents: a1e1023
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Oct 31 15:03:38 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Oct 31 15:03:38 2014 +0530

----------------------------------------------------------------------
 cloudmonkey/cloudmonkey.py | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/088001e7/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/cloudmonkey.py b/cloudmonkey/cloudmonkey.py
index 08ccb4d..4857723 100644
--- a/cloudmonkey/cloudmonkey.py
+++ b/cloudmonkey/cloudmonkey.py
@@ -366,6 +366,7 @@ class CloudMonkeyShell(cmd.Cmd, object):
             field_filter = filter(lambda x: x is not '',
                                   map(lambda x: x.strip(),
                                       args_dict.pop('filter').split(',')))
+            field_filter = list(set(field_filter))
 
         missing = []
         if verb in self.apicache and subject in self.apicache[verb]:


[2/3] git commit: requester: stderr and json loads fixes

Posted by bh...@apache.org.
requester: stderr and json loads fixes

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/commit/a1e1023e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/a1e1023e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/a1e1023e

Branch: refs/heads/master
Commit: a1e1023e04f7878e901d98af658ce3d9242fa214
Parents: fd32746
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Oct 31 14:59:09 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Oct 31 14:59:09 2014 +0530

----------------------------------------------------------------------
 cloudmonkey/requester.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/a1e1023e/cloudmonkey/requester.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/requester.py b/cloudmonkey/requester.py
index 91b61a2..eaf9de9 100644
--- a/cloudmonkey/requester.py
+++ b/cloudmonkey/requester.py
@@ -43,6 +43,7 @@ def logger_debug(logger, message):
 
 def writeError(msg):
     sys.stderr.write(msg)
+    sys.stderr.write("\n")
 
 
 def login(url, username, password):
@@ -218,7 +219,7 @@ def monkeyrequest(command, args, isasync, asyncblock, logger, url,
 
     def process_json(response):
         try:
-            response = json.loads(unicode(response))
+            response = json.loads(response, "utf-8")
         except ValueError, e:
             logger_debug(logger, "Error processing json: %s" % e)
             writeError("Error processing json: %s" % e)