514 Commits

Author SHA1 Message Date
Rohit Yadav
36e7a7884e cli: fix autocompletion binding bug, make all params lowercase
- fix weird autocompletion bug which won't let you enter the letter b [0]
- make set params, api and secret key vars lowercase
- use partition to get strings for do_set
- while installing, check and only then add readline (requires gcc and can fail)
- show monkey prompt by default, let users change if needed

[0] http://superuser.com/questions/297527/cant-type-the-b-letter-in-python-shell-in-os-x

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 19:41:07 +05:30
Rohit Yadav
ac8ae30658 cli: fix argument parsing for set command, fixes unicode monkey char
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 17:59:53 +05:30
Rohit Yadav
77e957c91b cli: fix python sdist, add readline as installation requirement
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 17:06:11 +05:30
Rohit Yadav
b713865308 cli: pip install cloudmonkey works
Patch makes cloudmonkey installable and redistributable using source dist from
pypi under apache compliant license. Most visible issues have been solved and
cloudmonkey should work well with CloudStack 4.0 and master, also until APIs do
not change.

To install now:
    pip install cloudmonkey

or, if you have to:
    easy_install cloudmonkey

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 16:07:42 +05:30
Rohit Yadav
a94f6f19bb cli: make parsing robust using shlex
Parsing bug fixed using the simple lexical analysis library

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 15:19:08 +05:30
Rohit Yadav
5c24c34d7f cli: use partition instead of split to parse through args
Use partition instead of splitting on whitespace. This is little robust, but
may still fail for parameters whose values have whitespaces such as names etc.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 14:54:35 +05:30
Rohit Yadav
9e6b366023 cli: add autocompletion and dynamic help doc
- autocompletions for help docs
- more verbose doc strings with __doc__ import from the module and list of
  required args and all args

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 14:28:40 +05:30
Rohit Yadav
a1089c4304 cli: move code, refactor and add docstring
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 14:28:40 +05:30
Rohit Yadav
d0f9610355 cli: add feature to cache docstrings for an api
cached verb dictionary stores the following as a list:
- name of the API
- params (list of args)
- docstring

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 14:28:39 +05:30
Rohit Yadav
00d5c3f35c cli: fix help and doc strings, comments
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 14:28:39 +05:30
Rohit Yadav
c10eeb6036 cli: strip args else this fails on parsing
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-05 21:59:03 +05:30
Rohit Yadav
64907c1da4 cli: fix parsing args
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-05 21:59:03 +05:30
Rohit Yadav
c444bb3811 cli: don't get the required list as params
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-05 21:59:03 +05:30
Rohit Yadav
98d341d932 cli: add grammar to class
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-05 21:59:03 +05:30
Rohit Yadav
94649491be cli: fix color parsing
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-05 21:59:03 +05:30
Rohit Yadav
8c12f49dbe cli: fix intro message
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-05 21:59:03 +05:30
Rohit Yadav
5611a8eda2 cli: add logic to complete api parameters and use caching to optimize runtime
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-05 21:59:02 +05:30
Rohit Yadav
49b4786de6 cli: don't search rule in apis, filter apis that start with that rule
Search verb in apis takes more time than filtering out apis that start with
that verb from the grammar.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-05 18:15:48 +05:30
Rohit Yadav
46ad8d6f4e cli: remind user to set host, port too
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-05 18:15:47 +05:30
Rohit Yadav
51a5377d05 cli: add more verbs to grammar
Adds additional verbs to grammar of cli

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-01 14:12:08 +05:30
Chip Childers
000cc72042 CLOUDSTACK-422: XSL files missing license header
Added license headers to the apidoc XSL files that were fooling RAT.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-10-31 14:13:48 -04:00
Rohit Yadav
b38cf801ac cli: setup.py for cloudmonkey
Version are named in reflection of CloudStack.
<cli major-version>.<cloudstack minor>.<cloudstack.major>
So, for CloudStack 4.1.0, version for cli should be 0.1.4

To create distribution:
  python setup.py sdist
  python setup.py install

Using pip:
  pip install dist/cloudmonkey*

Or pretty soon, from cheese shop:
  pip install cloudmonkey

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-10-31 23:19:21 +05:30
Rohit Yadav
039b938ecc maven: pom.xml for tools/cli
copies marvin to cli/cloudmonkey/

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-10-31 23:19:17 +05:30
Rohit Yadav
2ceaa3911e cli: cloudmonkey the command line interface
cloudmonkey
-----------
Apache CloudStack's very own monkey powered command line interface based on Marvin.
The neglected robot and monkey should rule the world!

Features:
- it's a shell and also a terminal tool
- scalable to find and run old and new APIs
- intuitive grammar and verbs
- autocompletion (functional hack)
- shell execution using ! or shell
- cfg support: user defined variables, like prompt, ruler, host, port etc.
- history
- colors
- dynamic API loading and rule generation
- leverages Marvin to get latest autogenerated APIs
- emacs like shortcuts on prompt
- uses apiKey and secretKey to interact with mgmt server
- logs all client commands
- PEP-8 compliant code

TODOs:
- Reverse search
- Fix input and output processing

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-10-31 23:19:14 +05:30
Rohit Yadav
d72d3ee22b marvin: check and use logger
Checks and only then calls logger

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-10-31 23:18:06 +05:30
Prasanna Santhanam
802ddd43ca Summary: Moving the test integration libraries into marvin for CLI work
Detail: Integration tests use these libraries (base,utils,common) for
simplifying the usage of the API. These define the verbs of each
entity's usage (create, delete, add etc). For the CLI to present the
simplified API we'll leverage the integration libraries.

+ Fixes to setup-test-data.sh - kvm and xen each use a different version
of the built-in Cent OS template, 5.5 and 5.3 namely.

At a later point the setup-test-data script needs to be obsoleted.
ostypeids in tests should directly be determined from listOsTypes API
calls

Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1351520707 +0530
2012-10-29 20:23:02 +05:30
Rohit Yadav
c68c7e2a2d devcloud: Fix default template url and deploydb error
- Fix the default builtin template url. The previous url is not reachable by
  public network.
- Remove INSERT statement which already gets inserted in cloud.configuration
  by mvn -P developer -Ddeploydb

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-10-29 19:05:46 +05:30
Prasanna Santhanam
5b43d245a7 Summary: Extending API doc pom to package
Detail: Create tarball of apidocs for distribution from jenkins
% mvn -Pdeveloper package

Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1351321002 +0530
2012-10-27 12:26:42 +05:30
Prasanna Santhanam
241daa53c6 Summary: Mavenize marvin on master
Detail: Maven will now compile, install and deploy marvin using the
developer profile
    $ mvn -P developer

compile - compiles the cloudstackAPI
package - packages the marvin source distributable
deploy  - installs using pip (reqd python 2.7) the Marvin package in to
site-packages/

BUG-ID : CLOUDSTACK-378
Reported-by: Prasanna Santhanam <tsp@apache.org>
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1351319186 +0530
2012-10-27 11:56:25 +05:30
Prasanna Santhanam
6f2792eb4b Summary: Close the ssh transport from paramiko
Detail: SSH Transport to be explicitly closed in marvin.remoteSSHClient
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1351002168 +0530
2012-10-23 19:52:48 +05:30
Wido den Hollander
5e44e61127 docs: Build the installation guide instead of "all"
It seems that all the work is going into the installation guide instead
of the "-all" docs.

With this commit we build the installation guide documentation.
2012-10-22 12:08:11 +02:00
Prasanna Santhanam
fd5421670d Remove redundant code in try..except block
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1350839262 +0530
2012-10-21 22:39:21 +05:30
Edison Su
d1af01fbc8 add marvin project 2012-10-21 00:01:48 -07:00
Edison Su
b57be3389e add apidocs/devcloud projects 2012-10-21 00:01:47 -07:00
Prasanna Santhanam
9a90dc227e Distutils install_requires doesn't resolve dependencies
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1350733702 +0530
2012-10-20 17:18:22 +05:30
Prasanna Santhanam
355b152993 Summary: Replace pymysql in marvin with a stable mysql-connector-python
Detail: mysql-connector-python developed by Oracle will replace the MIT
licensed pymysql. mysql-connector-python is developed by Oracle and is
more favourable, faster and actively developed.

With this commit - the dbConnection object is also auto managed by
contextlib. Each transaction requests its own connection rather than
sharing one single connection for all the test runs.

BUG-ID : None
Reviewed-by: timeit comparison of pymysql and mysql-connector-python
Reported-by: dbExceptions and timeouts from Marvin test runs
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1350732083 +0530
2012-10-20 16:57:06 +05:30
Edison Su
f6ac4dbe5d fix some pom xml files indentation, add db.root.passowrd, add utils/conf/db.properties.override, add to create user cloud, add devcloud pom file
Conflicts:

	pom.xml
2012-10-19 15:27:19 -07:00
Chip Childers
4cb934dfa9 Added license header to a new file.
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-10-19 09:41:53 -04:00
Prasanna Santhanam
7460b01893 Summary: provide deployment config access to marvin's testcase
Detail:
Sometimes tests need ssh access to the management server to perform
verification such as:

1. Pings from mgmt_server to agents
2. snapshots exist on secondary storage - mountable from mgmt server

For these the tests will need access to the config of the deployment and
the ip address of the mgmt server.

Egs: integration/component/test_egress.py and integration/component/test_snapshots.py

BUG-ID : CLOUDSTACK-377
Reported-by: Prasanna Santhanam
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1350624903 +0530
2012-10-19 11:06:53 +05:30
Marcus Sorensen
a3c9a2b22d Summary: prepare-commit-msg skip merges, -m flag, squash, template
Detail: prepare-commit-msg now is skipped if -m flag is supplied, if user has
a template defined, if commit is a squash or a merge.

BUG-ID : none
Reviewed-by: Marcus Sorensen <marcus@betterservers.com>
Reported-by: Marcus Sorensen <marcus@betterservers.com>
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1350600822 -0600
2012-10-18 16:53:42 -06:00
Marcus Sorensen
9ba7509c70 Summary: add git prepare-commit-msg file
Detail: CloudStack committers can optionally use this file to prepopulate their
commits with a standard form. The idea was that it would help us get better
commit messages. It is set up locally up by running the following from the root
of the repo:

'ln -s ../../tools/git/prepare-commit-msg .git/hooks/prepare-commit-msg'

Additionally, a different prepare-commit-msg could potentially be committed for
each branch and the link will always point to the one that's checked out.

BUG-ID : none
Reviewed-by: Marcus Sorensen <marcus@betterservers.com>
Reported-by: Rohit Yadav <rohit.yadav@citrix.com>
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1350596087 -0600
2012-10-18 15:34:47 -06:00
Chip Childers
2ed1c53e0e Adding DISCLAIMER.txt to the marvin tool.
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-10-17 12:27:00 -04:00
Chip Childers
6e60a07566 CLOUDSTACK-326: Corrected marvin license file to be full ASLv2 license text
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-10-12 16:41:17 -04:00
Chip Childers
6151a29949 CLOUDSTACK-326: Combining Marvin Sandbox README with README.tools.md
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-10-12 16:11:17 -04:00
Chip Childers
a82761dfe3 Removed KEYS file copy operation from the source build script.
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-10-12 15:38:52 -04:00
Chip Childers
8c31af0e1c Source build modified to produce *.tar.bz2 instead of *.tar.gz
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-10-12 14:06:53 -04:00
Chip Childers
24978eed59 CLOUDSTACK-331: Added legal docs for ui/lib/excanvas.js
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-10-12 12:36:43 -04:00
Chip Childers
578bca08cb Dropping .zip archive format from the source build
This is due to the nature of ASF release votes,
and the desire to see each individual artifact be tested.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-10-12 11:08:12 -04:00
Prasanna Santhanam
c86c5d2cc0 Uniting all the READMEs from tools and test
There are various READMEs under Cloudstack. This makes it confusing for
finding the purpose of each directory and tool within the project. All
the necessary information can now be found in the top-level README.tools
that is markdown editable. For the most updated information however it
is best to provide a wiki link to the tool you have added. Each tool
lies in a seperate section, please keep formatting unchanged.
2012-10-12 17:01:20 +05:30
Prasanna Santhanam
780468659f uniting the READMEs
Many READMEs spread over the integration and marvin test related
information can now be found in the single top-level directory
2012-10-12 16:07:03 +05:30