def get_securitygroup(vm_):
 sgs = list_securitygroup()
 securitygroup = config.get_cloud_config_value('securitygroup', vm_, __opts__, search_global=False)
 if (not securitygroup):
  raise SaltCloudNotFound('No securitygroup ID specified for this VM.')
 if (securitygroup and (str(securitygroup) in sgs)):
  return sgs[securitygroup]['SecurityGroupId']
 raise SaltCloudNotFound("The specified security group, '{0}', could not be found.".format(securitygroup))

def get_securitygroup ( vm_ ) : sgs = list_securitygroup ( ) securitygroup = config . get_cloud_config_value ( 'securitygroup' , vm_ , __opts__ , search_global = False ) if ( not securitygroup ) : raise SaltCloudNotFound ( 'No securitygroup ID specified for this VM.' ) if ( securitygroup and ( str ( securitygroup ) in sgs ) ) : return sgs [ securitygroup ] [ 'SecurityGroupId' ] raise SaltCloudNotFound ( "The specified security group, '{0}', could not be found." . format ( securitygroup ) )
return the security group .