(context)
return resource
Generates one instanceTemplate resource.
Generates one instanceTemplate resource.
Generates one instanceTemplate resource .
def GenerateComputeVMTemplate(context):
  """Generates one instanceTemplate resource."""
  prop = context.properties
  project = prop.setdefault(PROJECT, context.env[PROJECT])
  vm_tpl = vm_instance.GenerateComputeVM(context,
                                         create_disks_separately=False)[-1]
  # Copy properties since they will be modified to be used as subproperties
  vm_props = copy.deepcopy(vm_tpl['properties'])
  common.TakeZoneOut(vm_props)
  vm_name = vm_tpl['name'][:-3]  # takes the -vm out

  # pyformat: disable
  resource = [
      {
          'name': vm_name,
          'type': default.TEMPLATE,
          'properties': {
              'project': project,
              'properties': vm_props,
          }
      }
  ]
  # pyformat: enable
  return resource
def GenerateComputeVMTemplate ( context ) : prop = context . properties project = prop . setdefault ( PROJECT , context . env [ PROJECT ] ) vm_tpl = vm_instance . GenerateComputeVM ( context , create_disks_separately = False ) [ - 1 ] # Copy properties since they will be modified to be used as subproperties vm_props = copy . deepcopy ( vm_tpl [ 'properties' ] ) common . TakeZoneOut ( vm_props ) vm_name = vm_tpl [ 'name' ] [ : - 3 ] # takes the -vm out # pyformat: disable resource = [ { 'name' : vm_name , 'type' : default . TEMPLATE , 'properties' : { 'project' : project , 'properties' : vm_props , } } ] # pyformat: enable return resource