def get_Chassis_instance(wildcards): """ Creates an instace of TEMPLATE and replace wildcards as specfied """ c = copy.deepcopy(_TEMPLATE) compsys=[{"@odata.id": "{rb}Systems/{linkSystem}".format(rb=wildcards['rb'],linkSystem=x)} for x in wildcards['linkSystem']] rcblocks=[{"@odata.id":"{rb}CompositionService/ResourceBlocks/{linkRB}".format(rb=wildcards['rb'],linkRB=x)} for x in wildcards['linkResourceBlocks']] c['Links']['ComputerSystems']=compsys c['Links']['ResourceBlocks']=rcblocks replace_recurse(c, wildcards) return c
def get_EgResource_instance(wildcards): """ Creates an instance of TEMPLATE and replaces wildcards as specfied. Also sets any unique values. Arguments: wildcard - A dictionary of wildcards strings and their replacement values """ c = copy.deepcopy(_TEMPLATE) replace_recurse(c, wildcards) # print ("fini c: ", c) c['SerialNumber'] = strgen.StringGenerator('[A-Z]{3}[0-9]{10}').render() return c
def get_ComputerSystem_instance(wildcards): c = copy.deepcopy(_TEMPLATE) replace_recurse(c, wildcards) return c
def get_Chassis_instance(wildcards): c = copy.deepcopy(_TEMPLATE) replace_recurse(c, wildcards) return c