[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a
Garrett Holmstrom
gholms at fedoraproject.org
Sun Jun 16 02:30:31 UTC 2013
The following commit has been merged in the master branch:
commit 34ff879454705bb31a6322243ba2e2ce8eb9f209
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Wed Feb 27 15:22:43 2013 -0800
Add long-since forgotten argtypes module
diff --git a/euca2ools/commands/elasticloadbalancing/__init__.py b/euca2ools/commands/autoscaling/argtypes.py
similarity index 57%
copy from euca2ools/commands/elasticloadbalancing/__init__.py
copy to euca2ools/commands/autoscaling/argtypes.py
index 4eac030..40d29d4 100644
--- a/euca2ools/commands/elasticloadbalancing/__init__.py
+++ b/euca2ools/commands/autoscaling/argtypes.py
@@ -28,31 +28,31 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-from requestbuilder import Arg, SERVICE
-import requestbuilder.auth
-import requestbuilder.service
-import requestbuilder.request
-from .. import Euca2ools
-
-class ELB(requestbuilder.service.BaseService):
- NAME = 'elasticloadbalancing'
- DESCRIPTION = 'Load balancing service'
- API_VERSION = '2012-06-01'
- AUTH_CLASS = requestbuilder.auth.QuerySigV2Auth
- URL_ENVVAR = 'AWS_ELB_URL'
-
-class ELBRequest(requestbuilder.request.AWSQueryRequest):
- SUITE = Euca2ools
- SERVICE_CLASS = ELB
- ARGS = [Arg('-U', '--url', dest='url', metavar='URL', route_to=SERVICE,
- help='load balancing service endpoint URL')]
-
- def parse_response(self, response):
- response_dict = requestbuilder.request.AWSQueryRequest.parse_response(
- self, response)
- useful_keys = list(filter(lambda x: x != 'ResponseMetadata',
- response_dict.keys()))
- if len(useful_keys) == 1:
- return response_dict[useful_keys[0]]
+def autoscaling_tag_def(tag_str):
+ tag_dict = {}
+ pieces = ','.split(tag_str)
+ for piece in pieces:
+ piece = piece.strip()
+ if '=' not in piece:
+ raise ValueError(("invalid tag definition: each segment of '{0}' "
+ "must have format KEY=VALUE").format(piece))
+ key, val = piece.split('=', 1)
+ if key == 'k':
+ tag_dict['Key'] = val
+ elif key == 'id':
+ tag_dict['ResourceId'] = val
+ elif key == 't':
+ tag_dict['ResourceType'] = val
+ elif key == 'v':
+ tag_dict['Value'] = val
+ elif key == 'p':
+ if val.lower() in ('true', 'false'):
+ tag_dict['PropagateAtLaunch'] = val.lower()
+ else:
+ raise ValueError("value for to 'p=' must be 'true' or 'false'")
else:
- return response_dict
+ raise ValueError("unrecognized tag segment '{0}'".format(piece))
+ if not tag_dict.get('Key'):
+ raise ValueError(
+ "tag '{0}' must contain a 'k=' segment with a non-empty value")
+ return tag_dict
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list