mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
cloudmonkey: print sync stats, asks users to use sync
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
38aec6fc4d
commit
cc9b7d4c20
@ -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):
|
||||
|
||||
@ -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():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user