diff --git a/tools/cli/cloudmonkey/cloudmonkey.py b/tools/cli/cloudmonkey/cloudmonkey.py index b5b185f2d6c..25422412613 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): diff --git a/tools/cli/cloudmonkey/config.py b/tools/cli/cloudmonkey/config.py index 5dfe09bf85d..6a5feab8d12 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():