Revision 6c35c63c
b/.gitignore | ||
---|---|---|
1 | 1 |
*.pyc |
2 |
.DS_Store |
|
3 |
bin/ |
|
2 |
*.egg-info |
|
4 | 3 |
_build |
b/MANIFEST.in | ||
---|---|---|
1 |
include README.rst |
/dev/null | ||
---|---|---|
1 |
README |
|
2 |
======= |
|
3 |
|
|
4 |
./kamaki is a simple, yet intuitive, command-line tool for managing clouds. |
|
5 |
|
|
6 |
It is an initial implementation of the OpenStack Compute API, v1.1, with custom |
|
7 |
extensions specific to the Synnefo IaaS cloud management software. |
b/README.rst | ||
---|---|---|
1 |
README |
|
2 |
======= |
|
3 |
|
|
4 |
./kamaki is a simple, yet intuitive, command-line tool for managing clouds. |
|
5 |
|
|
6 |
It is an initial implementation of the OpenStack Compute API, v1.1, with custom |
|
7 |
extensions specific to the Synnefo IaaS cloud management software. |
/dev/null | ||
---|---|---|
1 |
#!/usr/bin/env python |
|
2 |
|
|
3 |
import os |
|
4 |
import shutil |
|
5 |
import stat |
|
6 |
|
|
7 |
from os.path import exists, join |
|
8 |
|
|
9 |
|
|
10 |
SRCDIR = 'kamaki' |
|
11 |
DSTDIR = 'bin' |
|
12 |
DST = 'kamaki' |
|
13 |
|
|
14 |
FILES = ('config.py', 'utils.py', 'client.py', 'cli.py') |
|
15 |
|
|
16 |
|
|
17 |
def cat(path, dst, skipheader=True): |
|
18 |
dst.write('\n') |
|
19 |
|
|
20 |
in_header = True |
|
21 |
for line in open(path): |
|
22 |
if in_header and line.strip() and not line.startswith('#'): |
|
23 |
in_header = False |
|
24 |
|
|
25 |
if line.startswith('from kamaki.'): |
|
26 |
continue # Skip local imports |
|
27 |
|
|
28 |
if skipheader and in_header: |
|
29 |
continue |
|
30 |
|
|
31 |
dst.write(line) |
|
32 |
|
|
33 |
|
|
34 |
def main(): |
|
35 |
if not exists(DSTDIR): |
|
36 |
os.makedirs(DSTDIR) |
|
37 |
dstpath = join(DSTDIR, DST) |
|
38 |
|
|
39 |
dst = open(dstpath, 'w') |
|
40 |
|
|
41 |
dst.write('#!/usr/bin/env python\n') |
|
42 |
|
|
43 |
cat(join(SRCDIR, '__init__.py'), dst, skipheader=False) |
|
44 |
|
|
45 |
for file in FILES: |
|
46 |
cat(join(SRCDIR, file), dst) |
|
47 |
|
|
48 |
dst.close() |
|
49 |
|
|
50 |
# Make file executable |
|
51 |
mode = stat.S_IMODE(os.stat(dstpath).st_mode) |
|
52 |
mode |= 0111 |
|
53 |
os.chmod(dstpath, mode) |
|
54 |
|
|
55 |
|
|
56 |
if __name__ == '__main__': |
|
57 |
main() |
b/setup.py | ||
---|---|---|
1 |
#!/usr/bin/env python |
|
2 |
|
|
3 |
# Copyright 2011 GRNET S.A. All rights reserved. |
|
4 |
# |
|
5 |
# Redistribution and use in source and binary forms, with or |
|
6 |
# without modification, are permitted provided that the following |
|
7 |
# conditions are met: |
|
8 |
# |
|
9 |
# 1. Redistributions of source code must retain the above |
|
10 |
# copyright notice, this list of conditions and the following |
|
11 |
# disclaimer. |
|
12 |
# |
|
13 |
# 2. Redistributions in binary form must reproduce the above |
|
14 |
# copyright notice, this list of conditions and the following |
|
15 |
# disclaimer in the documentation and/or other materials |
|
16 |
# provided with the distribution. |
|
17 |
# |
|
18 |
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS |
|
19 |
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
20 |
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|
21 |
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR |
|
22 |
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
23 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
24 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
25 |
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
|
26 |
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
27 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
|
28 |
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
29 |
# POSSIBILITY OF SUCH DAMAGE. |
|
30 |
# |
|
31 |
# The views and conclusions contained in the software and |
|
32 |
# documentation are those of the authors and should not be |
|
33 |
# interpreted as representing official policies, either expressed |
|
34 |
# or implied, of GRNET S.A. |
|
35 |
|
|
36 |
import kamaki |
|
37 |
|
|
38 |
from setuptools import setup |
|
39 |
|
|
40 |
|
|
41 |
setup( |
|
42 |
name='kamaki', |
|
43 |
version=kamaki.__version__, |
|
44 |
description='A command-line tool for managing clouds', |
|
45 |
long_description=open('README.rst').read(), |
|
46 |
url='http://code.grnet.gr/projects/kamaki', |
|
47 |
license='BSD', |
|
48 |
packages=['kamaki'], |
|
49 |
include_package_data=True, |
|
50 |
entry_points={ |
|
51 |
'console_scripts': ['kamaki = kamaki.cli:main'] |
|
52 |
} |
|
53 |
) |
Also available in: Unified diff