Hi Milindu, On Sun, Jun 7, 2015 at 11:14 PM, Milindu Sanoj Kumarage < agentmili...@gmail.com> wrote:
> > I added a POM to my module dir, much like Python Agent's one, but without > some dependencies and plugins which seems not relevant to Python CLI. Now > Python CLI would be treated as a child component :) > Great! The dependencies and the plugins in the PCA POM are for the Java integration test that was written to test the PCA. Therefore you would not need those entries in the Python CLI POM unless you're writing a Java test for it as well. > > I finished the @auth decorator as we discussed in previous discussions. > Now working well in Single Command Mode ( Non-Interactive Mode ) and > Interactive Mode mode. > > When starting in the Interactive Mode, I prompt for username and password. > I'm using 'getpass' built-in module here, to get the password without > echoing to bash, like how it happens in Git, etc. > +1 > > When in Single Command Mode ( Non-Interactive Mode ), when the user has > not given an username and a password as flags and they are not even set as > Environment Variables, then we should prompt for username and password? Or > just notify the user and terminate? > The Java CLI behavior is to prompt for the username and the password in case they are not provided. However, IMO the CLI should only notify the user and terminate. When the CLI is used in the non-interactive mode, it is most likely included in a (ex: Bash) script. In that case it should notify of the error and continue, rather than hang up and wait for user input (thus the name "non-interactive" :) ). WDYT? > > I'm working on defining Exception types, like NotAuthorizedException > NoEnoughPermissionsException, etc. I'm going to raise these exceptions > looking at the response codes and response messages of the Stratos REST > API. > > What are the other possible exceptions? And I need your ideas and > suggestions here :) > +1. Basing the exceptions on the HTTP status codes would be granular enough. > > I want to know few more things, > > 1. Are there any CLI actions that does not need an username and a > password? > AFAIK all the CLI actions require authentication. > > 2. Because we are having a POM, we have to do something with it, right? > Shall we build the binary distributions when in build phase? And run Python > CLI specific tests in test phase? But it seems there are no Maven modules > for Python, it seems we have to use Maven Exec plugin here. What you > think? :) > +1. We should build an artifact that can be distributed. For the PCA, an archive is created when building the project. In the Python CLI case, you can prepare a uploadable PIP package in the package phase. Also +1 for using Exec Maven plugin to run the Python tests. You can map the executions to the Maven test phase. Just a minor point on the source code. [image: Inline image 1] In Configs.py I noticed that "~" symbol is used. Is this portable to Windows? If not let's keep that in mind and test only in Linux for now. We will have to make it portable to Windows as well. Regards, Chamila de Alwis Committer and PMC Member - Apache Stratos Software Engineer | WSO2 | +94772207163 Blog: code.chamiladealwis.com