From d017a77744bfbdfc0d3e9cdd4974aa290bb264e2 Mon Sep 17 00:00:00 2001 From: Sebastien Estienne Date: Sat, 22 Nov 2014 12:04:55 -0800 Subject: [PATCH 1/2] fixing some documentation in boto_* states --- salt/states/boto_elb.py | 6 +++++- salt/states/boto_route53.py | 2 +- salt/states/boto_sqs.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/salt/states/boto_elb.py b/salt/states/boto_elb.py index 0dd1816407..efa2632a33 100644 --- a/salt/states/boto_elb.py +++ b/salt/states/boto_elb.py @@ -31,7 +31,7 @@ as a passed in dict, or as a string to pull from pillars or minion config: myprofile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs - region: us-east-1 + region: us-east-1 .. code-block:: yaml @@ -39,6 +39,10 @@ as a passed in dict, or as a string to pull from pillars or minion config: boto_elb.present: - name: myelb - region: us-east-1 + - availability_zones: + - us-east-1a + - us-east-1c + - us-east-1d - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs - listeners: diff --git a/salt/states/boto_route53.py b/salt/states/boto_route53.py index 673211c6b6..3b20afa18b 100644 --- a/salt/states/boto_route53.py +++ b/salt/states/boto_route53.py @@ -31,7 +31,7 @@ as a passed in dict, or as a string to pull from pillars or minion config: myprofile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs - region: us-east-1 + region: us-east-1 .. code-block:: yaml diff --git a/salt/states/boto_sqs.py b/salt/states/boto_sqs.py index 281f59b748..4e05476ac0 100644 --- a/salt/states/boto_sqs.py +++ b/salt/states/boto_sqs.py @@ -31,7 +31,7 @@ as a passed in dict, or as a string to pull from pillars or minion config: myprofile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs - region: us-east-1 + region: us-east-1 .. code-block:: yaml From d0ad5cf547e6dc7f359f8a4e1d342c92b03874fe Mon Sep 17 00:00:00 2001 From: Sebastien Estienne Date: Sat, 22 Nov 2014 12:43:54 -0800 Subject: [PATCH 2/2] add more informations in boto_elb errors messages --- salt/modules/boto_elb.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/salt/modules/boto_elb.py b/salt/modules/boto_elb.py index 0a6ed4b432..bf75c1dd16 100644 --- a/salt/modules/boto_elb.py +++ b/salt/modules/boto_elb.py @@ -166,7 +166,7 @@ def create(name, availability_zones, listeners=None, subnets=None, return False except boto.exception.BotoServerError as e: log.debug(e) - msg = 'Failed to create ELB {0}'.format(name) + msg = 'Failed to create ELB {0}: {1}'.format(name, e.message) log.error(msg) return False @@ -231,7 +231,7 @@ def create_listeners(name, listeners=None, region=None, key=None, keyid=None, return True except boto.exception.BotoServerError as e: log.debug(e) - msg = 'Failed to create ELB listeners on {0}'.format(name) + msg = 'Failed to create ELB listeners on {0}: {1}'.format(name, e.message) log.error(msg) return False @@ -257,7 +257,7 @@ def delete_listeners(name, ports, region=None, key=None, keyid=None, return True except boto.exception.BotoServerError as e: log.debug(e) - msg = 'Failed to delete ELB listeners on {0}'.format(name) + msg = 'Failed to delete ELB listeners on {0}: {1}'.format(name, e.message) log.error(msg) return False @@ -283,7 +283,7 @@ def enable_availability_zones(name, availability_zones, region=None, key=None, return True except boto.exception.BotoServerError as e: log.debug(e) - msg = 'Failed to enable availability_zones on ELB {0}'.format(name) + msg = 'Failed to enable availability_zones on ELB {0}: {1}'.format(name, e.message) log.error(msg) return False @@ -309,7 +309,7 @@ def disable_availability_zones(name, availability_zones, region=None, key=None, return True except boto.exception.BotoServerError as e: log.debug(e) - msg = 'Failed to disable availability_zones on ELB {0}'.format(name) + msg = 'Failed to disable availability_zones on ELB {0}: {1}'.format(name, e.message) log.error(msg) return False @@ -335,7 +335,7 @@ def attach_subnets(name, subnets, region=None, key=None, keyid=None, return True except boto.exception.BotoServerError as e: log.debug(e) - msg = 'Failed to attach ELB {0} on subnets.'.format(name) + msg = 'Failed to attach ELB {0} on subnets: {1}'.format(name, e.message) log.error(msg) return False @@ -361,7 +361,7 @@ def detach_subnets(name, subnets, region=None, key=None, keyid=None, return True except boto.exception.BotoServerError as e: log.debug(e) - msg = 'Failed to detach ELB {0} from subnets.'.format(name) + msg = 'Failed to detach ELB {0} from subnets: {1}'.format(name, e.message) log.error(msg) return False @@ -392,7 +392,7 @@ def get_attributes(name, region=None, key=None, keyid=None, profile=None): return ret except boto.exception.BotoServerError as e: log.debug(e) - log.error('ELB {0} does not exist.'.format(name)) + log.error('ELB {0} does not exist: {1}'.format(name, e.message)) return {} @@ -468,7 +468,7 @@ def get_health_check(name, region=None, key=None, keyid=None, profile=None): return ret except boto.exception.BotoServerError as e: log.debug(e) - log.error('ELB {0} does not exist.'.format(name)) + log.error('ELB {0} does not exist: {1}'.format(name, e.message)) return {} @@ -490,7 +490,7 @@ def set_health_check(name, health_check, region=None, key=None, keyid=None, log.info('Configured health check on ELB {0}'.format(name)) except boto.exception.BotoServerError as e: log.debug(e) - log.info('Failed to configure health check on ELB {0}'.format(name)) + log.info('Failed to configure health check on ELB {0}: {1}'.format(name, e.message)) return False return True