Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

# 0.10.0
## 0.1.1-boto3

- Updated boto3 version to >= 1.4.7, < 1.5
- Removed deprecated action import path

## 0.10.0

- Updated action `runner_type` from `run-python` to `python-script`

Expand All @@ -16,6 +21,17 @@

* Corrected incomplete error handling and validation of configuration (#22).

## v0.6.0

* Fix the result format of some of the actions such as ``ec2_run_instances``. Previously,
the result was a list of lists of dicts and now the result is correctly a list of dicts.

Keep in mind that this is a breaking changes.

If you previously accessed the result of the ``ec2_run_instances`` action in the action-chain
workflow like that - ``run_instances.result[0][0].id``, you need to update it so it looks like
this ``run_instance.result[0].id``.

## v0.3.0

* Added CloudFormation, VPC, IAM, RDS, SQS, S3
Expand Down
14 changes: 0 additions & 14 deletions CHANGES.rst

This file was deleted.

2 changes: 1 addition & 1 deletion actions/assume_role.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import boto3

from st2actions.runners.pythonrunner import Action
from st2common.runners.base_action import Action

from lib.util import json_serial

Expand Down
2 changes: 1 addition & 1 deletion actions/boto3action.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import boto3

from st2actions.runners.pythonrunner import Action
from st2common.runners.base_action import Action
from lib.util import json_serial


Expand Down
3 changes: 2 additions & 1 deletion actions/lib/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import boto.vpc
import boto3

from st2actions.runners.pythonrunner import Action
from st2common.runners.base_action import Action
from ec2parsers import ResultSets


Expand Down Expand Up @@ -64,6 +64,7 @@ def cf_connect(self):

def r53_connect(self):
del self.credentials['region']
# pylint: disable=E1123
return boto.route53.connection.Route53Connection(**self.credentials)

def get_r53zone(self, zone):
Expand Down
11 changes: 6 additions & 5 deletions etc/st2packgen/st2packgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def convert(name):
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()


parser = argparse.ArgumentParser(description="Generate aws stackstorm actions")
parser.add_argument('-d', '--outputdir', default="actions", help="base output directory")
parser.add_argument('-s', '--service', default=None, help="service to generate actions for (eg s3)")
Expand All @@ -32,7 +33,7 @@ def convert(name):

try:
os.stat(outputdir)
except:
except Exception:
os.mkdir(outputdir)

templateLoader = jinja2.FileSystemLoader(searchpath="templates")
Expand All @@ -54,7 +55,7 @@ def convert(name):
print "\n%s\n" % e
sys.exit(1)

for op in mysrv.operation_names:
for op in mysrv.operation_names: # pylint: disable=not-an-iterable

allvars = {}
allvars['paramsreq'] = []
Expand All @@ -72,13 +73,13 @@ def convert(name):
if model.input_shape is None:
continue

members = model.input_shape.members
members = model.input_shape.members # pylint: disable=no-member

smodel = model.service_model

# print smodel._shape_resolver

smembers = model.input_shape._shape_model['members']
smembers = model.input_shape._shape_model['members'] # pylint: disable=no-member
for sname, sdata in smembers.items():
tmp = {}
stype = smodel._shape_resolver._shape_map[sdata['shape']]['type']
Expand Down Expand Up @@ -107,7 +108,7 @@ def convert(name):
else:
tmp['description'] = ''

if sname in model.input_shape.required_members:
if sname in model.input_shape.required_members: # pylint: disable=no-member
allvars['paramsreq'].append(tmp)
else:
allvars['params'].append(tmp)
Expand Down
2 changes: 1 addition & 1 deletion pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ keywords:
- SQS
- lambda

version : 0.1.0-boto3
version : 0.1.1-boto3
author : StackStorm, Inc.
email : info@stackstorm.com
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
six
boto>=2.41.0,<2.42
# Note: boto3 is used by the SQS sensor
boto3==1.4.5
boto3>=1.4.7,<1.5
flask>=0.10.1
34 changes: 0 additions & 34 deletions tests/test_action_initialize.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
import re
import sys

from aws_base_action_test_case import AWSBaseActionTestCase
from run import ActionManager


class MockStderr(object):
def __init__(self):
self.messages = []

def write(self, output):
self.messages.append(output)

def flush(self):
pass


class ActionInitializationTestCase(AWSBaseActionTestCase):
__test__ = True
action_cls = ActionManager
Expand All @@ -34,23 +20,3 @@ def test_get_action_with_blank_config(self):
action = self.get_action_instance({})

self.assertEqual(action.credentials['region'], None)

def test_get_action_with_invalid_config(self):
config = self.full_config
mock_stderr = MockStderr()

# set invalid parameter
config['st2_user_data'] = 'hogefuga'

# save stderr object
stderr_orig = sys.stderr
sys.stderr = mock_stderr

action = self.get_action_instance(config)

# retrieve original stderr object
sys.stderr = stderr_orig

self.assertTrue(len(mock_stderr.messages) > 0)
self.assertTrue(re.match(r".*No such file or directory.*hogefuga", mock_stderr.messages[0]))
self.assertEqual(action.credentials['region'], 'us-west-1')