[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a
Matt Spaulding
mspaulding06 at gmail.com
Sun Jun 16 02:31:14 UTC 2013
The following commit has been merged in the master branch:
commit 0bfd624961cba22e30107b9d88d5626e3b077749
Author: Matt Spaulding <mspaulding06 at gmail.com>
Date: Tue Apr 30 15:25:49 2013 -0700
TOOLS-308 Add euscale-create-or-update-tags
diff --git a/bin/euscale-create-or-update-tags b/bin/euscale-create-or-update-tags
new file mode 100755
index 0000000..6c384ee
--- /dev/null
+++ b/bin/euscale-create-or-update-tags
@@ -0,0 +1,6 @@
+#!/usr/bin/python -tt
+
+import euca2ools.commands.autoscaling.createorupdatetags
+
+if __name__ == '__main__':
+ euca2ools.commands.autoscaling.createorupdatetags.CreateOrUpdateTags.run()
diff --git a/euca2ools/commands/autoscaling/setdesiredcapacity.py b/euca2ools/commands/autoscaling/arghelpers.py
similarity index 59%
copy from euca2ools/commands/autoscaling/setdesiredcapacity.py
copy to euca2ools/commands/autoscaling/arghelpers.py
index 1c3e3b0..de4a484 100644
--- a/euca2ools/commands/autoscaling/setdesiredcapacity.py
+++ b/euca2ools/commands/autoscaling/arghelpers.py
@@ -28,21 +28,22 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-from euca2ools.commands.autoscaling import AutoScalingRequest
from requestbuilder import Arg
+from euca2ools.commands.autoscaling.argtypes import autoscaling_tag_def
-class SetDesiredCapacity(AutoScalingRequest):
- DESCRIPTION = "Set an auto-scaling group's desired capacity"
- ARGS = [Arg('AutoScalingGroupName', metavar='ASGROUP',
- help='name of the auto-scaling group to update (required)'),
- Arg('-c', '--desired-capacity', dest='DesiredCapacity', type=int,
- required=True,
- help='new capacity setting for the group (required)'),
- Arg('-h', '--honor-cooldown', dest='HonorCooldown',
- action='store_const', const='true',
- help='''reject the request if the group is in cooldown
- (default: override any cooldown period)'''),
- Arg('-H', '--no-honor-cooldown', dest='HonorCooldown',
- action='store_const', const='false',
- help='override any cooldown period (this is the default)')]
+
+class TagArg(Arg):
+ def __init__(self, required=False):
+ super(TagArg, self).__init__('--tag', dest='Tags.member',
+ type=autoscaling_tag_def,
+ action='append', required=required,
+ metavar=('"k=VALUE, id=VALUE, t=VALUE, '
+ 'v=VALUE, p={true,false}"'), help=('''
+ tags to create or update. Tags follow the following format:
+ "id=resource-name, t=resource-type, k=tag-key, v=tag-val,
+ p=propagate-at-launch-flag", where k is the tag's name, v is
+ the tag's value, id is a resource ID, t is a resource type, and
+ p is whether to propagate tags to instances created by the new
+ group. A value for 'k=' is required for each tag. The
+ remainders are optional.'''))
diff --git a/euca2ools/commands/autoscaling/createautoscalinggroup.py b/euca2ools/commands/autoscaling/createautoscalinggroup.py
index bed62cd..50d1955 100644
--- a/euca2ools/commands/autoscaling/createautoscalinggroup.py
+++ b/euca2ools/commands/autoscaling/createautoscalinggroup.py
@@ -30,7 +30,7 @@
from euca2ools.commands.argtypes import delimited_list
from euca2ools.commands.autoscaling import AutoScalingRequest
-from euca2ools.commands.autoscaling.argtypes import autoscaling_tag_def
+from euca2ools.commands.autoscaling.arghelpers import TagArg
from requestbuilder import Arg
@@ -64,16 +64,7 @@ class CreateAutoScalingGroup(AutoScalingRequest):
help='comma-separated list of load balancers to use'),
Arg('--placement-group', dest='PlacementGroup',
help='placement group in which to launch new instances'),
- Arg('--tag', dest='Tags.member', type=autoscaling_tag_def,
- action='append', metavar=('"k=VALUE, id=VALUE, t=VALUE, '
- 'v=VALUE, p={true,false}"'), help=('''
- tags to create or update. Tags follow the following format:
- "id=resource-name, t=resource-type, k=tag-key, v=tag-val,
- p=propagate-at-launch-flag", where k is the tag's name, v is
- the tag's value, id is a resource ID, t is a resource type, and
- p is whether to propagate tags to instances created by the new
- group. A value for 'k=' is required for each tag. The
- remainders are optional.''')),
+ TagArg(required=False),
Arg('--termination-policies', dest='TerminationPolicies.member',
metavar='POLICY1,POLICY2,...', type=delimited_list(','),
help='''ordered list of termination policies. The first has
diff --git a/euca2ools/nc/services.py b/euca2ools/commands/autoscaling/createorupdatetags.py
similarity index 81%
copy from euca2ools/nc/services.py
copy to euca2ools/commands/autoscaling/createorupdatetags.py
index 672da94..c41736e 100644
--- a/euca2ools/nc/services.py
+++ b/euca2ools/commands/autoscaling/createorupdatetags.py
@@ -28,9 +28,11 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-import euca2ools.nc.auth
-import euca2ools.commands.walrus
+from euca2ools.commands.argtypes import delimited_list
+from euca2ools.commands.autoscaling import AutoScalingRequest
+from euca2ools.commands.autoscaling.arghelpers import TagArg
-class NCInternalWalrus(euca2ools.commands.walrus.Walrus):
- AUTH_CLASS = euca2ools.nc.auth.EucaRsaV2Auth
+class CreateOrUpdateTags(AutoScalingRequest):
+ DESCRIPTION = 'Creates new tags or updates existing tags'
+ ARGS = [TagArg(required=True)]
diff --git a/setup.py b/setup.py
index 04b874d..49d2371 100644
--- a/setup.py
+++ b/setup.py
@@ -265,6 +265,7 @@ setup(name = "euca2ools",
"bin/eulb-set-lb-policies-of-listener",
"bin/euscale-create-auto-scaling-group",
"bin/euscale-create-launch-config",
+ "bin/euscale-create-or-update-tags",
"bin/euscale-delete-auto-scaling-group",
"bin/euscale-delete-launch-config",
"bin/euscale-delete-notification-configuration",
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list