Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit da6b7e4

Browse files
committed
Added POM and distribution for Python CLI. Fixed import issues in the CLI
1 parent f36e3f4 commit da6b7e4

File tree

18 files changed

+443
-24
lines changed

18 files changed

+443
-24
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--
2+
~ Licensed to the Apache Software Foundation (ASF) under one
3+
~ or more contributor license agreements. See the NOTICE file
4+
~ distributed with this work for additional information
5+
~ regarding copyright ownership. The ASF licenses this file
6+
~ to you under the Apache License, Version 2.0 (the
7+
~ "License"); you may not use this file except in compliance
8+
~ with the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing,
13+
~ software distributed under the License is distributed on an
14+
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
~ KIND, either express or implied. See the License for the
16+
~ specific language governing permissions and limitations
17+
~ under the License.
18+
-->
19+
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22+
<modelVersion>4.0.0</modelVersion>
23+
<parent>
24+
<groupId>org.apache.stratos</groupId>
25+
<artifactId>stratos-components-parent</artifactId>
26+
<version>4.1.4-SNAPSHOT</version>
27+
</parent>
28+
29+
<artifactId>org.apache.stratos.python.cli</artifactId>
30+
<packaging>pom</packaging>
31+
<name>Apache Stratos - Python CLI</name>
32+
</project>

components/org.apache.stratos.python.cli/src/main/python/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
Apache Stratos CLI
22
==================
3+
4+
#Pre-requisites
5+
Install the required Python packages by issuing the following `pip install` commands.
6+
7+
```python
8+
pip install cmd2
9+
pip install texttable
10+
11+
12+
```
313

414
Build and install stratos CLI by,
515

components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from Utils import *
2020
from Stratos import *
2121
import Configs
22-
from cli.exceptions import BadResponseError
22+
from Exceptions import BadResponseError
2323

2424

2525
class CLI(Cmd):
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
88
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
9+
# http://www.apache.org/licenses/LICENSE-2.0
1010
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
@@ -15,10 +15,11 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
1819
class BadResponseError(Exception):
1920
def __init__(self, error_code, message=""):
2021
self.error_code = error_code
2122
self.message = message
2223

2324
def __str__(self):
24-
return self.message
25+
return self.message

components/org.apache.stratos.python.cli/src/main/python/cli/Main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import Configs
2323

2424
# Fix Python 2.x.
25-
from cli.Stratos import Stratos
26-
from cli.exceptions import BadResponseError
25+
from Stratos import Stratos
26+
from Exceptions import BadResponseError
2727

2828
try:
2929
input = raw_input

components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import json
2020
import Configs
2121
from Logging import logging
22-
from cli.exceptions.BadResponseError import BadResponseError
22+
from Exceptions import BadResponseError
2323

2424

2525
class Stratos:

components/org.apache.stratos.python.cli/src/main/python/cli/exceptions/__init__.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

components/org.apache.stratos.python.cli/src/main/python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def read(file_name):
2525

2626
setup(
2727
name="stratos",
28-
version="0.0.5",
28+
version="4.1.4",
2929
author="Apache Stratos",
3030
author_email="[email protected]",
3131
description="CLI tool to interact with Apache Stratos",

components/org.apache.stratos.python.cli/src/main/python/tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
envlist = py27, py34
33
[testenv]
44
deps=pytest
5+
responses
56
commands=py.test

components/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<module>org.apache.stratos.manager</module>
4141
<module>org.apache.stratos.cli</module>
4242
<module>org.apache.stratos.python.cartridge.agent</module>
43+
<module>org.apache.stratos.python.cli</module>
4344
<module>org.apache.stratos.cartridge.agent</module>
4445
<module>org.apache.stratos.load.balancer.common</module>
4546
<module>org.apache.stratos.load.balancer</module>

0 commit comments

Comments
 (0)