Example #1
0
 def call(*args, **kwargs):
     ss = core.steady_aws_stacks(utils.find_region())
     keys = lmap(first, ss)
     idx = dict(zip(keys, ss))
     helpfn = lambda pick: idx[pick][1]
     if not keys:
         print('\nno AWS stacks *in a steady state* exist, cannot continue.')
         return
     stackname = first(args) or os.environ.get('INSTANCE')
     if not stackname or stackname not in keys:
         stackname = utils._pick("stack", sorted(keys), helpfn=helpfn, default_file=deffile('.active-stack'))
     return func(stackname, *args[1:], **kwargs)
Example #2
0
 def call(*args, **kwargs):
     stackname = first(args) or os.environ.get('INSTANCE')
     region = aws.find_region(stackname)
     asl = core.active_stack_names(region)
     if not asl:
         raise RuntimeError(
             '\nno AWS stacks *in an active state* exist, cannot continue.')
     if not stackname or stackname not in asl:
         stackname = utils._pick("stack",
                                 asl,
                                 default_file=deffile('.active-stack'))
     args = args[1:]
     return func(stackname, *args, **kwargs)
Example #3
0
 def call(*args, **kwargs):
     stackname = first(args) or os.environ.get('INSTANCE')
     region = utils.find_region(stackname)
     if stackname:
         args = args[1:]
         return func(stackname, *args, **kwargs)
     asl = core.active_stack_names(region)
     if not asl:
         raise RuntimeError('\nno AWS stacks *in an active state* exist, cannot continue.')
     if not stackname or stackname not in asl:
         stackname = utils._pick("stack", asl, default_file=deffile('.active-stack'))
     args = args[1:]
     return func(stackname, *args, **kwargs)
Example #4
0
 def call(*args, **kwargs):
     ss = core.steady_aws_stacks(aws.find_region())
     keys = map(first, ss)
     idx = dict(zip(keys, ss))
     helpfn = lambda pick: idx[pick][1]
     if not keys:
         print '\nno AWS stacks *in a steady state* exist, cannot continue.'
         return
     stackname = first(args) or os.environ.get('INSTANCE')
     if not stackname or stackname not in keys:
         stackname = utils._pick("stack",
                                 keys,
                                 helpfn=helpfn,
                                 default_file=deffile('.active-stack'))
     return func(stackname, *args[1:], **kwargs)