Updated Branches: refs/heads/4.1 580763553 -> aba3585d9
cloudmonkey: print sync stats, asks users to use sync Signed-off-by: Rohit Yadav <[email protected]> (cherry picked from commit cc9b7d4c208ac68dc25f8507c6162f395400a8a7) Signed-off-by: Rohit Yadav <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/aba3585d Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/aba3585d Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/aba3585d Branch: refs/heads/4.1 Commit: aba3585d932408d0af444e56bec5703af298da9a Parents: 5807635 Author: Rohit Yadav <[email protected]> Authored: Wed Mar 6 17:20:40 2013 +0530 Committer: Chip Childers <[email protected]> Committed: Wed Mar 6 10:25:57 2013 -0500 ---------------------------------------------------------------------- tools/cli/cloudmonkey/cloudmonkey.py | 9 ++++++--- tools/cli/cloudmonkey/config.py | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/aba3585d/tools/cli/cloudmonkey/cloudmonkey.py ---------------------------------------------------------------------- diff --git a/tools/cli/cloudmonkey/cloudmonkey.py b/tools/cli/cloudmonkey/cloudmonkey.py index b5b185f..2542241 100644 --- a/tools/cli/cloudmonkey/cloudmonkey.py +++ b/tools/cli/cloudmonkey/cloudmonkey.py @@ -42,7 +42,7 @@ except ImportError, e: try: from precache import apicache except ImportError: - apicache = {} + apicache = {'count': 0, 'verbs': [], 'asyncapis': []} try: import readline @@ -327,11 +327,14 @@ class CloudMonkeyShell(cmd.Cmd, object): it rollbacks last datastore or api precached datastore. """ response = self.make_request("listApis") - self.apicache = monkeycache(response) if response is None: - monkeyprint("Failed to sync apis, check your config") + monkeyprint("Failed to sync apis, please check your config?") + monkeyprint("Note: `sync` requires api discovery service enabled" + + " on the CloudStack management server") return + self.apicache = monkeycache(response) savecache(self.apicache, self.cache_file) + monkeyprint("%s APIs discovered and cached" % self.apicache["count"]) self.loadcache() def do_api(self, args): http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/aba3585d/tools/cli/cloudmonkey/config.py ---------------------------------------------------------------------- diff --git a/tools/cli/cloudmonkey/config.py b/tools/cli/cloudmonkey/config.py index 5dfe09b..6a5feab 100644 --- a/tools/cli/cloudmonkey/config.py +++ b/tools/cli/cloudmonkey/config.py @@ -99,6 +99,7 @@ def read_config(get_attr, set_attr): print "Welcome! Using `set` configure the necessary settings:" print " ".join(sorted(config_options)) print "Config file:", config_file + print "After setting up, run the `sync` command to sync apis\n" missing_keys = [] for section in config_fields.keys():
