diff --git a/tools/cli/cloudmonkey/cachegen.py b/tools/cli/cloudmonkey/cachegen.py
index e03b6fddf89..509c0c68587 100644
--- a/tools/cli/cloudmonkey/cachegen.py
+++ b/tools/cli/cloudmonkey/cachegen.py
@@ -16,11 +16,13 @@
# under the License.
try:
- from common import grammar
+ import re
from marvin.cloudstackAPI import *
from marvin import cloudstackAPI
except ImportError, e:
- pass
+ import sys
+ print "ImportError", e
+ sys.exit(1)
completions = cloudstackAPI.__all__
@@ -43,9 +45,12 @@ def main():
completing commands and help docs. This reduces the overall search and
cache_miss (computation) complexity from O(n) to O(1) for any valid cmd.
"""
+ pattern = re.compile("[A-Z]")
+ verbs = list(set([x[:pattern.search(x).start()] for x in completions
+ if pattern.search(x) is not None]).difference(['cloudstack']))
# datastructure {'verb': {cmd': ['api', [params], doc, required=[]]}}
cache_verbs = {}
- for verb in grammar:
+ for verb in verbs:
completions_found = filter(lambda x: x.startswith(verb), completions)
cache_verbs[verb] = {}
for api_name in completions_found:
diff --git a/tools/cli/cloudmonkey/cloudmonkey.py b/tools/cli/cloudmonkey/cloudmonkey.py
index aabcde543fb..ecd0c82fb11 100644
--- a/tools/cli/cloudmonkey/cloudmonkey.py
+++ b/tools/cli/cloudmonkey/cloudmonkey.py
@@ -514,7 +514,7 @@ class CloudMonkeyShell(cmd.Cmd, object):
def main():
pattern = re.compile("[A-Z]")
verbs = list(set([x[:pattern.search(x).start()] for x in completions
- if pattern.search(x) is not None]))
+ if pattern.search(x) is not None]).difference(['cloudstack']))
for verb in verbs:
def add_grammar(verb):
def grammar_closure(self, args):
diff --git a/tools/cli/pom.xml b/tools/cli/pom.xml
index c76cd650d42..aba5ec3c2a5 100644
--- a/tools/cli/pom.xml
+++ b/tools/cli/pom.xml
@@ -71,6 +71,20 @@
+
+ cachegen
+ compile
+
+ exec
+
+
+ ${basedir}/cloudmonkey
+ python
+
+ cachegen.py
+
+
+
package
compile