From a1fa8eff408920266c6701ef087c30382d7471e7 Mon Sep 17 00:00:00 2001 From: Przemyslaw Kaminski Date: Thu, 10 Sep 2015 08:59:30 +0200 Subject: [PATCH 1/2] Fixes for more syntax errors/wrong arguments passing --- solar/solar/cli/main.py | 11 +---------- solar/solar/core/signals.py | 2 +- solar/solar/errors.py | 4 ++++ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/solar/solar/cli/main.py b/solar/solar/cli/main.py index 58b3873f..08b08e7f 100644 --- a/solar/solar/cli/main.py +++ b/solar/solar/cli/main.py @@ -182,14 +182,6 @@ def init_cli_connections(): #plt.savefig('graph.png') -def init_cli_deployment_config(): - @main.command() - @click.argument('filepath') - def deploy(filepath): - click.echo('Deploying from file {}'.format(filepath)) - xd.deploy(filepath) - - def init_cli_resource(): @main.group() def resource(): @@ -296,7 +288,6 @@ def init_cli_resource(): if output: echo(output) - @resource.command() @click.argument('resource_name') @click.argument('tag_name') @@ -308,7 +299,7 @@ def init_cli_resource(): r.add_tag(tag_name) else: r.remove_tag(tag_name) - r.save() + # TODO: the above functions should save resource automatically to the DB @resource.command() @click.argument('name') diff --git a/solar/solar/core/signals.py b/solar/solar/core/signals.py index 226682c8..735d1138 100644 --- a/solar/solar/core/signals.py +++ b/solar/solar/core/signals.py @@ -252,7 +252,7 @@ def notify(source, key, value): resource = load(client) log.debug('Resource found: %s', client) if resource: - resource.update({r_key: value}, emitter=source) + resource.update({r_key: value}) else: log.debug('Resource %s deleted?', client) pass diff --git a/solar/solar/errors.py b/solar/solar/errors.py index 982ddfb2..074ecd29 100644 --- a/solar/solar/errors.py +++ b/solar/solar/errors.py @@ -24,5 +24,9 @@ class CannotFindExtension(SolarError): pass +class LexError(SolarError): + pass + + class ParseError(SolarError): pass From f7aa04fa28a877b35ce38e1fc0cf3c035d2ea737 Mon Sep 17 00:00:00 2001 From: Przemyslaw Kaminski Date: Thu, 10 Sep 2015 12:36:32 +0200 Subject: [PATCH 2/2] Fix wrong variable in riaks.py --- examples/riak/riaks.py | 2 +- solar/solar/errors.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/riak/riaks.py b/examples/riak/riaks.py index 28606f58..3b4c7c73 100644 --- a/examples/riak/riaks.py +++ b/examples/riak/riaks.py @@ -73,7 +73,7 @@ def setup_riak(): local_errors = validation.validate_resource(r) if local_errors: has_errors = True - print 'ERROR: %s: %s' % (r.name, errors) + print 'ERROR: %s: %s' % (r.name, local_errors) if has_errors: print "ERRORS" diff --git a/solar/solar/errors.py b/solar/solar/errors.py index 074ecd29..09d102fb 100644 --- a/solar/solar/errors.py +++ b/solar/solar/errors.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. + class SolarError(Exception): pass