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 2016/01/12 19:30:26 UTC

cloudstack-cloudmonkey git commit: cloudmonkey: return autocompletion suggestions sorted by name

Repository: cloudstack-cloudmonkey
Updated Branches:
  refs/heads/master f5c7c691b -> 32b110a34


cloudmonkey: return autocompletion suggestions sorted by name

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/32b110a3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/32b110a3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/32b110a3

Branch: refs/heads/master
Commit: 32b110a343acb98b5f6f89238ab57af88b2a47df
Parents: f5c7c69
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Tue Jan 12 23:59:52 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Jan 12 23:59:52 2016 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/32b110a3/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/cloudmonkey.py b/cloudmonkey/cloudmonkey.py
index 1a643e4..b057a2a 100644
--- a/cloudmonkey/cloudmonkey.py
+++ b/cloudmonkey/cloudmonkey.py
@@ -580,7 +580,9 @@ class CloudMonkeyShell(cmd.Cmd, object):
                         uuids = self.update_param_cache(api, response)
                     if len(uuids) > 1:
                         print
-                        for option in self.param_cache[api]["options"]:
+                        options = sorted(self.param_cache[api]["options"],
+                                         key=lambda x: x[1])
+                        for option in options:
                             uuid = option[0]
                             name = option[1]
                             if uuid.startswith(value):