partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | list_datastore_full | Returns a dictionary with the basic information for the given datastore:
name, type, url, capacity, free, used, usage, hosts
service_instance
The Service Instance Object from which to obtain datastores.
datastore
Name of the datastore. | salt/utils/vmware.py | def list_datastore_full(service_instance, datastore):
'''
Returns a dictionary with the basic information for the given datastore:
name, type, url, capacity, free, used, usage, hosts
service_instance
The Service Instance Object from which to obtain datastores.
datastore
Name of... | def list_datastore_full(service_instance, datastore):
'''
Returns a dictionary with the basic information for the given datastore:
name, type, url, capacity, free, used, usage, hosts
service_instance
The Service Instance Object from which to obtain datastores.
datastore
Name of... | [
"Returns",
"a",
"dictionary",
"with",
"the",
"basic",
"information",
"for",
"the",
"given",
"datastore",
":",
"name",
"type",
"url",
"capacity",
"free",
"used",
"usage",
"hosts"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1959-L1992 | [
"def",
"list_datastore_full",
"(",
"service_instance",
",",
"datastore",
")",
":",
"datastore_object",
"=",
"get_mor_by_name",
"(",
"service_instance",
",",
"vim",
".",
"Datastore",
",",
"datastore",
")",
"if",
"not",
"datastore_object",
":",
"raise",
"salt",
".",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_mor_by_name | Get reference to an object of specified object type and name
si
ServiceInstance for the vSphere or ESXi server (see get_service_instance)
obj_type
Type of the object (vim.StoragePod, vim.Datastore, etc)
obj_name
Name of the object | salt/utils/vmware.py | def get_mor_by_name(si, obj_type, obj_name):
'''
Get reference to an object of specified object type and name
si
ServiceInstance for the vSphere or ESXi server (see get_service_instance)
obj_type
Type of the object (vim.StoragePod, vim.Datastore, etc)
obj_name
Name of the ... | def get_mor_by_name(si, obj_type, obj_name):
'''
Get reference to an object of specified object type and name
si
ServiceInstance for the vSphere or ESXi server (see get_service_instance)
obj_type
Type of the object (vim.StoragePod, vim.Datastore, etc)
obj_name
Name of the ... | [
"Get",
"reference",
"to",
"an",
"object",
"of",
"specified",
"object",
"type",
"and",
"name"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L1995-L2013 | [
"def",
"get_mor_by_name",
"(",
"si",
",",
"obj_type",
",",
"obj_name",
")",
":",
"inventory",
"=",
"get_inventory",
"(",
"si",
")",
"container",
"=",
"inventory",
".",
"viewManager",
".",
"CreateContainerView",
"(",
"inventory",
".",
"rootFolder",
",",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_mor_by_moid | Get reference to an object of specified object type and id
si
ServiceInstance for the vSphere or ESXi server (see get_service_instance)
obj_type
Type of the object (vim.StoragePod, vim.Datastore, etc)
obj_moid
ID of the object | salt/utils/vmware.py | def get_mor_by_moid(si, obj_type, obj_moid):
'''
Get reference to an object of specified object type and id
si
ServiceInstance for the vSphere or ESXi server (see get_service_instance)
obj_type
Type of the object (vim.StoragePod, vim.Datastore, etc)
obj_moid
ID of the obje... | def get_mor_by_moid(si, obj_type, obj_moid):
'''
Get reference to an object of specified object type and id
si
ServiceInstance for the vSphere or ESXi server (see get_service_instance)
obj_type
Type of the object (vim.StoragePod, vim.Datastore, etc)
obj_moid
ID of the obje... | [
"Get",
"reference",
"to",
"an",
"object",
"of",
"specified",
"object",
"type",
"and",
"id"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2016-L2034 | [
"def",
"get_mor_by_moid",
"(",
"si",
",",
"obj_type",
",",
"obj_moid",
")",
":",
"inventory",
"=",
"get_inventory",
"(",
"si",
")",
"container",
"=",
"inventory",
".",
"viewManager",
".",
"CreateContainerView",
"(",
"inventory",
".",
"rootFolder",
",",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_datastore_files | Get the files with a given browser specification from the datastore.
service_instance
The Service Instance Object from which to obtain datastores.
directory
The name of the directory where we would like to search
datastores
Name of the datastores
container_object
The ... | salt/utils/vmware.py | def get_datastore_files(service_instance, directory, datastores, container_object, browser_spec):
'''
Get the files with a given browser specification from the datastore.
service_instance
The Service Instance Object from which to obtain datastores.
directory
The name of the directory w... | def get_datastore_files(service_instance, directory, datastores, container_object, browser_spec):
'''
Get the files with a given browser specification from the datastore.
service_instance
The Service Instance Object from which to obtain datastores.
directory
The name of the directory w... | [
"Get",
"the",
"files",
"with",
"a",
"given",
"browser",
"specification",
"from",
"the",
"datastore",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2037-L2081 | [
"def",
"get_datastore_files",
"(",
"service_instance",
",",
"directory",
",",
"datastores",
",",
"container_object",
",",
"browser_spec",
")",
":",
"files",
"=",
"[",
"]",
"datastore_objects",
"=",
"get_datastores",
"(",
"service_instance",
",",
"container_object",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_datastores | Returns a list of vim.Datastore objects representing the datastores visible
from a VMware object, filtered by their names, or the backing disk
cannonical name or scsi_addresses
service_instance
The Service Instance Object from which to obtain datastores.
reference
The VMware object fro... | salt/utils/vmware.py | def get_datastores(service_instance, reference, datastore_names=None,
backing_disk_ids=None, get_all_datastores=False):
'''
Returns a list of vim.Datastore objects representing the datastores visible
from a VMware object, filtered by their names, or the backing disk
cannonical name or... | def get_datastores(service_instance, reference, datastore_names=None,
backing_disk_ids=None, get_all_datastores=False):
'''
Returns a list of vim.Datastore objects representing the datastores visible
from a VMware object, filtered by their names, or the backing disk
cannonical name or... | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"Datastore",
"objects",
"representing",
"the",
"datastores",
"visible",
"from",
"a",
"VMware",
"object",
"filtered",
"by",
"their",
"names",
"or",
"the",
"backing",
"disk",
"cannonical",
"name",
"or",
"scsi_addresses"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2084-L2211 | [
"def",
"get_datastores",
"(",
"service_instance",
",",
"reference",
",",
"datastore_names",
"=",
"None",
",",
"backing_disk_ids",
"=",
"None",
",",
"get_all_datastores",
"=",
"False",
")",
":",
"obj_name",
"=",
"get_managed_object_name",
"(",
"reference",
")",
"if... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rename_datastore | Renames a datastore
datastore_ref
vim.Datastore reference to the datastore object to be changed
new_datastore_name
New datastore name | salt/utils/vmware.py | def rename_datastore(datastore_ref, new_datastore_name):
'''
Renames a datastore
datastore_ref
vim.Datastore reference to the datastore object to be changed
new_datastore_name
New datastore name
'''
ds_name = get_managed_object_name(datastore_ref)
log.trace("Renaming datast... | def rename_datastore(datastore_ref, new_datastore_name):
'''
Renames a datastore
datastore_ref
vim.Datastore reference to the datastore object to be changed
new_datastore_name
New datastore name
'''
ds_name = get_managed_object_name(datastore_ref)
log.trace("Renaming datast... | [
"Renames",
"a",
"datastore"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2214-L2238 | [
"def",
"rename_datastore",
"(",
"datastore_ref",
",",
"new_datastore_name",
")",
":",
"ds_name",
"=",
"get_managed_object_name",
"(",
"datastore_ref",
")",
"log",
".",
"trace",
"(",
"\"Renaming datastore '%s' to '%s'\"",
",",
"ds_name",
",",
"new_datastore_name",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_partition_info | Returns partition informations for a device path, of type
vim.HostDiskPartitionInfo | salt/utils/vmware.py | def _get_partition_info(storage_system, device_path):
'''
Returns partition informations for a device path, of type
vim.HostDiskPartitionInfo
'''
try:
partition_infos = \
storage_system.RetrieveDiskPartitionInfo(
devicePath=[device_path])
except vim.fa... | def _get_partition_info(storage_system, device_path):
'''
Returns partition informations for a device path, of type
vim.HostDiskPartitionInfo
'''
try:
partition_infos = \
storage_system.RetrieveDiskPartitionInfo(
devicePath=[device_path])
except vim.fa... | [
"Returns",
"partition",
"informations",
"for",
"a",
"device",
"path",
"of",
"type",
"vim",
".",
"HostDiskPartitionInfo"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2266-L2287 | [
"def",
"_get_partition_info",
"(",
"storage_system",
",",
"device_path",
")",
":",
"try",
":",
"partition_infos",
"=",
"storage_system",
".",
"RetrieveDiskPartitionInfo",
"(",
"devicePath",
"=",
"[",
"device_path",
"]",
")",
"except",
"vim",
".",
"fault",
".",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_new_computed_partition_spec | Computes the new disk partition info when adding a new vmfs partition that
uses up the remainder of the disk; returns a tuple
(new_partition_number, vim.HostDiskPartitionSpec | salt/utils/vmware.py | def _get_new_computed_partition_spec(storage_system,
device_path,
partition_info):
'''
Computes the new disk partition info when adding a new vmfs partition that
uses up the remainder of the disk; returns a tuple
(new_partition_nu... | def _get_new_computed_partition_spec(storage_system,
device_path,
partition_info):
'''
Computes the new disk partition info when adding a new vmfs partition that
uses up the remainder of the disk; returns a tuple
(new_partition_nu... | [
"Computes",
"the",
"new",
"disk",
"partition",
"info",
"when",
"adding",
"a",
"new",
"vmfs",
"partition",
"that",
"uses",
"up",
"the",
"remainder",
"of",
"the",
"disk",
";",
"returns",
"a",
"tuple",
"(",
"new_partition_number",
"vim",
".",
"HostDiskPartitionSp... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2290-L2350 | [
"def",
"_get_new_computed_partition_spec",
"(",
"storage_system",
",",
"device_path",
",",
"partition_info",
")",
":",
"log",
".",
"trace",
"(",
"'Adding a partition at the end of the disk and getting the new '",
"'computed partition spec'",
")",
"# TODO implement support for multi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_vmfs_datastore | Creates a VMFS datastore from a disk_id
host_ref
vim.HostSystem object referencing a host to create the datastore on
datastore_name
Name of the datastore
disk_ref
vim.HostScsiDislk on which the datastore is created
vmfs_major_version
VMFS major version to use | salt/utils/vmware.py | def create_vmfs_datastore(host_ref, datastore_name, disk_ref,
vmfs_major_version, storage_system=None):
'''
Creates a VMFS datastore from a disk_id
host_ref
vim.HostSystem object referencing a host to create the datastore on
datastore_name
Name of the datastor... | def create_vmfs_datastore(host_ref, datastore_name, disk_ref,
vmfs_major_version, storage_system=None):
'''
Creates a VMFS datastore from a disk_id
host_ref
vim.HostSystem object referencing a host to create the datastore on
datastore_name
Name of the datastor... | [
"Creates",
"a",
"VMFS",
"datastore",
"from",
"a",
"disk_id"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2353-L2412 | [
"def",
"create_vmfs_datastore",
"(",
"host_ref",
",",
"datastore_name",
",",
"disk_ref",
",",
"vmfs_major_version",
",",
"storage_system",
"=",
"None",
")",
":",
"# TODO Support variable sized partitions",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_host_datastore_system | Returns a host's datastore system
host_ref
Reference to the ESXi host
hostname
Name of the host. This argument is optional. | salt/utils/vmware.py | def get_host_datastore_system(host_ref, hostname=None):
'''
Returns a host's datastore system
host_ref
Reference to the ESXi host
hostname
Name of the host. This argument is optional.
'''
if not hostname:
hostname = get_managed_object_name(host_ref)
service_instanc... | def get_host_datastore_system(host_ref, hostname=None):
'''
Returns a host's datastore system
host_ref
Reference to the ESXi host
hostname
Name of the host. This argument is optional.
'''
if not hostname:
hostname = get_managed_object_name(host_ref)
service_instanc... | [
"Returns",
"a",
"host",
"s",
"datastore",
"system"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2415-L2443 | [
"def",
"get_host_datastore_system",
"(",
"host_ref",
",",
"hostname",
"=",
"None",
")",
":",
"if",
"not",
"hostname",
":",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
"service_instance",
"=",
"get_service_instance_from_managed_object",
"(",
"host... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove_datastore | Creates a VMFS datastore from a disk_id
service_instance
The Service Instance Object containing the datastore
datastore_ref
The reference to the datastore to remove | salt/utils/vmware.py | def remove_datastore(service_instance, datastore_ref):
'''
Creates a VMFS datastore from a disk_id
service_instance
The Service Instance Object containing the datastore
datastore_ref
The reference to the datastore to remove
'''
ds_props = get_properties_of_managed_object(
... | def remove_datastore(service_instance, datastore_ref):
'''
Creates a VMFS datastore from a disk_id
service_instance
The Service Instance Object containing the datastore
datastore_ref
The reference to the datastore to remove
'''
ds_props = get_properties_of_managed_object(
... | [
"Creates",
"a",
"VMFS",
"datastore",
"from",
"a",
"disk_id"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2446-L2481 | [
"def",
"remove_datastore",
"(",
"service_instance",
",",
"datastore_ref",
")",
":",
"ds_props",
"=",
"get_properties_of_managed_object",
"(",
"datastore_ref",
",",
"[",
"'host'",
",",
"'info'",
",",
"'name'",
"]",
")",
"ds_name",
"=",
"ds_props",
"[",
"'name'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_hosts | Returns a list of vim.HostSystem objects representing ESXi hosts
in a vcenter filtered by their names and/or datacenter, cluster membership.
service_instance
The Service Instance Object from which to obtain the hosts.
datacenter_name
The datacenter name. Default is None.
host_names
... | salt/utils/vmware.py | def get_hosts(service_instance, datacenter_name=None, host_names=None,
cluster_name=None, get_all_hosts=False):
'''
Returns a list of vim.HostSystem objects representing ESXi hosts
in a vcenter filtered by their names and/or datacenter, cluster membership.
service_instance
The Ser... | def get_hosts(service_instance, datacenter_name=None, host_names=None,
cluster_name=None, get_all_hosts=False):
'''
Returns a list of vim.HostSystem objects representing ESXi hosts
in a vcenter filtered by their names and/or datacenter, cluster membership.
service_instance
The Ser... | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"HostSystem",
"objects",
"representing",
"ESXi",
"hosts",
"in",
"a",
"vcenter",
"filtered",
"by",
"their",
"names",
"and",
"/",
"or",
"datacenter",
"cluster",
"membership",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2484-L2547 | [
"def",
"get_hosts",
"(",
"service_instance",
",",
"datacenter_name",
"=",
"None",
",",
"host_names",
"=",
"None",
",",
"cluster_name",
"=",
"None",
",",
"get_all_hosts",
"=",
"False",
")",
":",
"properties",
"=",
"[",
"'name'",
"]",
"if",
"cluster_name",
"an... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_scsi_address_to_lun_key_map | Returns a map between the scsi addresses and the keys of all luns on an ESXi
host.
map[<scsi_address>] = <lun key>
service_instance
The Service Instance Object from which to obtain the hosts
host_ref
The vim.HostSystem object representing the host that contains the
requeste... | salt/utils/vmware.py | def _get_scsi_address_to_lun_key_map(service_instance,
host_ref,
storage_system=None,
hostname=None):
'''
Returns a map between the scsi addresses and the keys of all luns on an ESXi
host.
... | def _get_scsi_address_to_lun_key_map(service_instance,
host_ref,
storage_system=None,
hostname=None):
'''
Returns a map between the scsi addresses and the keys of all luns on an ESXi
host.
... | [
"Returns",
"a",
"map",
"between",
"the",
"scsi",
"addresses",
"and",
"the",
"keys",
"of",
"all",
"luns",
"on",
"an",
"ESXi",
"host",
".",
"map",
"[",
"<scsi_address",
">",
"]",
"=",
"<lun",
"key",
">"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2550-L2610 | [
"def",
"_get_scsi_address_to_lun_key_map",
"(",
"service_instance",
",",
"host_ref",
",",
"storage_system",
"=",
"None",
",",
"hostname",
"=",
"None",
")",
":",
"if",
"not",
"hostname",
":",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_all_luns | Returns a list of all vim.HostScsiDisk objects in a disk
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
storage_system
The host's storage system. Default is None.
hostname
Name of the host. This argument is optional. | salt/utils/vmware.py | def get_all_luns(host_ref, storage_system=None, hostname=None):
'''
Returns a list of all vim.HostScsiDisk objects in a disk
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
storage_system
The host's storage system. Default is None.
... | def get_all_luns(host_ref, storage_system=None, hostname=None):
'''
Returns a list of all vim.HostScsiDisk objects in a disk
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
storage_system
The host's storage system. Default is None.
... | [
"Returns",
"a",
"list",
"of",
"all",
"vim",
".",
"HostScsiDisk",
"objects",
"in",
"a",
"disk"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2613-L2660 | [
"def",
"get_all_luns",
"(",
"host_ref",
",",
"storage_system",
"=",
"None",
",",
"hostname",
"=",
"None",
")",
":",
"if",
"not",
"hostname",
":",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
"if",
"not",
"storage_system",
":",
"si",
"=",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_scsi_address_to_lun_map | Returns a map of all vim.ScsiLun objects on a ESXi host keyed by their
scsi address
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
storage_system
The host's storage system. Default is None.
hostname
Name of the host. This ar... | salt/utils/vmware.py | def get_scsi_address_to_lun_map(host_ref, storage_system=None, hostname=None):
'''
Returns a map of all vim.ScsiLun objects on a ESXi host keyed by their
scsi address
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
storage_system
... | def get_scsi_address_to_lun_map(host_ref, storage_system=None, hostname=None):
'''
Returns a map of all vim.ScsiLun objects on a ESXi host keyed by their
scsi address
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
storage_system
... | [
"Returns",
"a",
"map",
"of",
"all",
"vim",
".",
"ScsiLun",
"objects",
"on",
"a",
"ESXi",
"host",
"keyed",
"by",
"their",
"scsi",
"address"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2663-L2689 | [
"def",
"get_scsi_address_to_lun_map",
"(",
"host_ref",
",",
"storage_system",
"=",
"None",
",",
"hostname",
"=",
"None",
")",
":",
"if",
"not",
"hostname",
":",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
"si",
"=",
"get_service_instance_from... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_disks | Returns a list of vim.HostScsiDisk objects representing disks
in a ESXi host, filtered by their cannonical names and scsi_addresses
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
disk_ids
The list of canonical names of the disks to be re... | salt/utils/vmware.py | def get_disks(host_ref, disk_ids=None, scsi_addresses=None,
get_all_disks=False):
'''
Returns a list of vim.HostScsiDisk objects representing disks
in a ESXi host, filtered by their cannonical names and scsi_addresses
host_ref
The vim.HostSystem object representing the host that c... | def get_disks(host_ref, disk_ids=None, scsi_addresses=None,
get_all_disks=False):
'''
Returns a list of vim.HostScsiDisk objects representing disks
in a ESXi host, filtered by their cannonical names and scsi_addresses
host_ref
The vim.HostSystem object representing the host that c... | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"HostScsiDisk",
"objects",
"representing",
"disks",
"in",
"a",
"ESXi",
"host",
"filtered",
"by",
"their",
"cannonical",
"names",
"and",
"scsi_addresses"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2692-L2745 | [
"def",
"get_disks",
"(",
"host_ref",
",",
"disk_ids",
"=",
"None",
",",
"scsi_addresses",
"=",
"None",
",",
"get_all_disks",
"=",
"False",
")",
":",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
"if",
"get_all_disks",
":",
"log",
".",
"tr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_disk_partition_info | Returns all partitions on a disk
host_ref
The reference of the ESXi host containing the disk
disk_id
The canonical name of the disk whose partitions are to be removed
storage_system
The ESXi host's storage system. Default is None. | salt/utils/vmware.py | def get_disk_partition_info(host_ref, disk_id, storage_system=None):
'''
Returns all partitions on a disk
host_ref
The reference of the ESXi host containing the disk
disk_id
The canonical name of the disk whose partitions are to be removed
storage_system
The ESXi host's st... | def get_disk_partition_info(host_ref, disk_id, storage_system=None):
'''
Returns all partitions on a disk
host_ref
The reference of the ESXi host containing the disk
disk_id
The canonical name of the disk whose partitions are to be removed
storage_system
The ESXi host's st... | [
"Returns",
"all",
"partitions",
"on",
"a",
"disk"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2748-L2790 | [
"def",
"get_disk_partition_info",
"(",
"host_ref",
",",
"disk_id",
",",
"storage_system",
"=",
"None",
")",
":",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
"service_instance",
"=",
"get_service_instance_from_managed_object",
"(",
"host_ref",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | erase_disk_partitions | Erases all partitions on a disk
in a vcenter filtered by their names and/or datacenter, cluster membership
service_instance
The Service Instance Object from which to obtain all information
host_ref
The reference of the ESXi host containing the disk
disk_id
The canonical name ... | salt/utils/vmware.py | def erase_disk_partitions(service_instance, host_ref, disk_id,
hostname=None, storage_system=None):
'''
Erases all partitions on a disk
in a vcenter filtered by their names and/or datacenter, cluster membership
service_instance
The Service Instance Object from which t... | def erase_disk_partitions(service_instance, host_ref, disk_id,
hostname=None, storage_system=None):
'''
Erases all partitions on a disk
in a vcenter filtered by their names and/or datacenter, cluster membership
service_instance
The Service Instance Object from which t... | [
"Erases",
"all",
"partitions",
"on",
"a",
"disk"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2793-L2864 | [
"def",
"erase_disk_partitions",
"(",
"service_instance",
",",
"host_ref",
",",
"disk_id",
",",
"hostname",
"=",
"None",
",",
"storage_system",
"=",
"None",
")",
":",
"if",
"not",
"hostname",
":",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_diskgroups | Returns a list of vim.VsanHostDiskMapping objects representing disks
in a ESXi host, filtered by their cannonical names.
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
cache_disk_ids
The list of cannonical names of the cache disks to be ... | salt/utils/vmware.py | def get_diskgroups(host_ref, cache_disk_ids=None, get_all_disk_groups=False):
'''
Returns a list of vim.VsanHostDiskMapping objects representing disks
in a ESXi host, filtered by their cannonical names.
host_ref
The vim.HostSystem object representing the host that contains the
requested... | def get_diskgroups(host_ref, cache_disk_ids=None, get_all_disk_groups=False):
'''
Returns a list of vim.VsanHostDiskMapping objects representing disks
in a ESXi host, filtered by their cannonical names.
host_ref
The vim.HostSystem object representing the host that contains the
requested... | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"VsanHostDiskMapping",
"objects",
"representing",
"disks",
"in",
"a",
"ESXi",
"host",
"filtered",
"by",
"their",
"cannonical",
"names",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2867-L2924 | [
"def",
"get_diskgroups",
"(",
"host_ref",
",",
"cache_disk_ids",
"=",
"None",
",",
"get_all_disk_groups",
"=",
"False",
")",
":",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
"if",
"get_all_disk_groups",
":",
"log",
".",
"trace",
"(",
"'Retr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_disks_in_diskgroup | Checks that the disks in a disk group are as expected and raises
CheckError exceptions if the check fails | salt/utils/vmware.py | def _check_disks_in_diskgroup(disk_group, cache_disk_id, capacity_disk_ids):
'''
Checks that the disks in a disk group are as expected and raises
CheckError exceptions if the check fails
'''
if not disk_group.ssd.canonicalName == cache_disk_id:
raise salt.exceptions.ArgumentValueError(
... | def _check_disks_in_diskgroup(disk_group, cache_disk_id, capacity_disk_ids):
'''
Checks that the disks in a disk group are as expected and raises
CheckError exceptions if the check fails
'''
if not disk_group.ssd.canonicalName == cache_disk_id:
raise salt.exceptions.ArgumentValueError(
... | [
"Checks",
"that",
"the",
"disks",
"in",
"a",
"disk",
"group",
"are",
"as",
"expected",
"and",
"raises",
"CheckError",
"exceptions",
"if",
"the",
"check",
"fails"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2927-L2944 | [
"def",
"_check_disks_in_diskgroup",
"(",
"disk_group",
",",
"cache_disk_id",
",",
"capacity_disk_ids",
")",
":",
"if",
"not",
"disk_group",
".",
"ssd",
".",
"canonicalName",
"==",
"cache_disk_id",
":",
"raise",
"salt",
".",
"exceptions",
".",
"ArgumentValueError",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_host_cache | Returns a vim.HostScsiDisk if the host cache is configured on the specified
host, other wise returns None
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
host_cache_manager
The vim.HostCacheConfigurationManager object representing the cac... | salt/utils/vmware.py | def get_host_cache(host_ref, host_cache_manager=None):
'''
Returns a vim.HostScsiDisk if the host cache is configured on the specified
host, other wise returns None
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
host_cache_manager
... | def get_host_cache(host_ref, host_cache_manager=None):
'''
Returns a vim.HostScsiDisk if the host cache is configured on the specified
host, other wise returns None
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
host_cache_manager
... | [
"Returns",
"a",
"vim",
".",
"HostScsiDisk",
"if",
"the",
"host",
"cache",
"is",
"configured",
"on",
"the",
"specified",
"host",
"other",
"wise",
"returns",
"None"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2948-L2985 | [
"def",
"get_host_cache",
"(",
"host_ref",
",",
"host_cache_manager",
"=",
"None",
")",
":",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
"service_instance",
"=",
"get_service_instance_from_managed_object",
"(",
"host_ref",
")",
"log",
".",
"trace"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | configure_host_cache | Configures the host cahe of the specified host
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
datastore_ref
The vim.Datastore opject representing the datastore the host cache will
be configured on.
swap_size_MiB
The size... | salt/utils/vmware.py | def configure_host_cache(host_ref, datastore_ref, swap_size_MiB,
host_cache_manager=None):
'''
Configures the host cahe of the specified host
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
datastore_ref
The v... | def configure_host_cache(host_ref, datastore_ref, swap_size_MiB,
host_cache_manager=None):
'''
Configures the host cahe of the specified host
host_ref
The vim.HostSystem object representing the host that contains the
requested disks.
datastore_ref
The v... | [
"Configures",
"the",
"host",
"cahe",
"of",
"the",
"specified",
"host"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L2989-L3040 | [
"def",
"configure_host_cache",
"(",
"host_ref",
",",
"datastore_ref",
",",
"swap_size_MiB",
",",
"host_cache_manager",
"=",
"None",
")",
":",
"hostname",
"=",
"get_managed_object_name",
"(",
"host_ref",
")",
"if",
"not",
"host_cache_manager",
":",
"props",
"=",
"g... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_resource_pools | Retrieves resource pool objects
service_instance
The service instance object to query the vCenter
resource_pool_names
Resource pool names
datacenter_name
Name of the datacenter where the resource pool is available
get_all_resource_pools
Boolean
return
Res... | salt/utils/vmware.py | def get_resource_pools(service_instance, resource_pool_names, datacenter_name=None,
get_all_resource_pools=False):
'''
Retrieves resource pool objects
service_instance
The service instance object to query the vCenter
resource_pool_names
Resource pool names
d... | def get_resource_pools(service_instance, resource_pool_names, datacenter_name=None,
get_all_resource_pools=False):
'''
Retrieves resource pool objects
service_instance
The service instance object to query the vCenter
resource_pool_names
Resource pool names
d... | [
"Retrieves",
"resource",
"pool",
"objects"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3053-L3097 | [
"def",
"get_resource_pools",
"(",
"service_instance",
",",
"resource_pool_names",
",",
"datacenter_name",
"=",
"None",
",",
"get_all_resource_pools",
"=",
"False",
")",
":",
"properties",
"=",
"[",
"'name'",
"]",
"if",
"not",
"resource_pool_names",
":",
"resource_po... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | wait_for_task | Waits for a task to be completed.
task
The task to wait for.
instance_name
The name of the ESXi host, vCenter Server, or Virtual Machine that
the task is being run on.
task_type
The type of task being performed. Useful information for debugging purposes.
sleep_seconds... | salt/utils/vmware.py | def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):
'''
Waits for a task to be completed.
task
The task to wait for.
instance_name
The name of the ESXi host, vCenter Server, or Virtual Machine that
the task is being run on.
task_type
... | def wait_for_task(task, instance_name, task_type, sleep_seconds=1, log_level='debug'):
'''
Waits for a task to be completed.
task
The task to wait for.
instance_name
The name of the ESXi host, vCenter Server, or Virtual Machine that
the task is being run on.
task_type
... | [
"Waits",
"for",
"a",
"task",
"to",
"be",
"completed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3170-L3270 | [
"def",
"wait_for_task",
"(",
"task",
",",
"instance_name",
",",
"task_type",
",",
"sleep_seconds",
"=",
"1",
",",
"log_level",
"=",
"'debug'",
")",
":",
"time_counter",
"=",
"0",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"log",
".",
"trace",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_vm_by_property | Get virtual machine properties based on the traversal specs and properties list,
returns Virtual Machine object with properties.
service_instance
Service instance object to access vCenter
name
Name of the virtual machine.
datacenter
Datacenter name
vm_properties
L... | salt/utils/vmware.py | def get_vm_by_property(service_instance, name, datacenter=None, vm_properties=None,
traversal_spec=None, parent_ref=None):
'''
Get virtual machine properties based on the traversal specs and properties list,
returns Virtual Machine object with properties.
service_instance
... | def get_vm_by_property(service_instance, name, datacenter=None, vm_properties=None,
traversal_spec=None, parent_ref=None):
'''
Get virtual machine properties based on the traversal specs and properties list,
returns Virtual Machine object with properties.
service_instance
... | [
"Get",
"virtual",
"machine",
"properties",
"based",
"on",
"the",
"traversal",
"specs",
"and",
"properties",
"list",
"returns",
"Virtual",
"Machine",
"object",
"with",
"properties",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3273-L3326 | [
"def",
"get_vm_by_property",
"(",
"service_instance",
",",
"name",
",",
"datacenter",
"=",
"None",
",",
"vm_properties",
"=",
"None",
",",
"traversal_spec",
"=",
"None",
",",
"parent_ref",
"=",
"None",
")",
":",
"if",
"datacenter",
"and",
"not",
"parent_ref",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_folder | Returns a Folder Object
service_instance
Service instance object
datacenter
Name of the datacenter
placement
Placement dictionary
base_vm_name
Existing virtual machine name (for cloning) | salt/utils/vmware.py | def get_folder(service_instance, datacenter, placement, base_vm_name=None):
'''
Returns a Folder Object
service_instance
Service instance object
datacenter
Name of the datacenter
placement
Placement dictionary
base_vm_name
Existing virtual machine name (for cl... | def get_folder(service_instance, datacenter, placement, base_vm_name=None):
'''
Returns a Folder Object
service_instance
Service instance object
datacenter
Name of the datacenter
placement
Placement dictionary
base_vm_name
Existing virtual machine name (for cl... | [
"Returns",
"a",
"Folder",
"Object"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3329-L3369 | [
"def",
"get_folder",
"(",
"service_instance",
",",
"datacenter",
",",
"placement",
",",
"base_vm_name",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving folder information'",
")",
"if",
"base_vm_name",
":",
"vm_object",
"=",
"get_vm_by_property",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_placement | To create a virtual machine a resource pool needs to be supplied, we would like to use the strictest as possible.
datacenter
Name of the datacenter
placement
Dictionary with the placement info, cluster, host resource pool name
return
Resource pool, cluster and host object if any a... | salt/utils/vmware.py | def get_placement(service_instance, datacenter, placement=None):
'''
To create a virtual machine a resource pool needs to be supplied, we would like to use the strictest as possible.
datacenter
Name of the datacenter
placement
Dictionary with the placement info, cluster, host resource ... | def get_placement(service_instance, datacenter, placement=None):
'''
To create a virtual machine a resource pool needs to be supplied, we would like to use the strictest as possible.
datacenter
Name of the datacenter
placement
Dictionary with the placement info, cluster, host resource ... | [
"To",
"create",
"a",
"virtual",
"machine",
"a",
"resource",
"pool",
"needs",
"to",
"be",
"supplied",
"we",
"would",
"like",
"to",
"use",
"the",
"strictest",
"as",
"possible",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3372-L3451 | [
"def",
"get_placement",
"(",
"service_instance",
",",
"datacenter",
",",
"placement",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving placement information'",
")",
"resourcepool_object",
",",
"placement_object",
"=",
"None",
",",
"None",
"if",
"'host... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | convert_to_kb | Converts the given size to KB based on the unit, returns a long integer.
unit
Unit of the size eg. GB; Note: to VMware a GB is the same as GiB = 1024MiB
size
Number which represents the size | salt/utils/vmware.py | def convert_to_kb(unit, size):
'''
Converts the given size to KB based on the unit, returns a long integer.
unit
Unit of the size eg. GB; Note: to VMware a GB is the same as GiB = 1024MiB
size
Number which represents the size
'''
if unit.lower() == 'gb':
# vCenter needs ... | def convert_to_kb(unit, size):
'''
Converts the given size to KB based on the unit, returns a long integer.
unit
Unit of the size eg. GB; Note: to VMware a GB is the same as GiB = 1024MiB
size
Number which represents the size
'''
if unit.lower() == 'gb':
# vCenter needs ... | [
"Converts",
"the",
"given",
"size",
"to",
"KB",
"based",
"on",
"the",
"unit",
"returns",
"a",
"long",
"integer",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3454-L3472 | [
"def",
"convert_to_kb",
"(",
"unit",
",",
"size",
")",
":",
"if",
"unit",
".",
"lower",
"(",
")",
"==",
"'gb'",
":",
"# vCenter needs long value",
"target_size",
"=",
"int",
"(",
"size",
"*",
"1024",
"*",
"1024",
")",
"elif",
"unit",
".",
"lower",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | power_cycle_vm | Powers on/off a virtual machine specified by it's name.
virtual_machine
vim.VirtualMachine object to power on/off virtual machine
action
Operation option to power on/off the machine | salt/utils/vmware.py | def power_cycle_vm(virtual_machine, action='on'):
'''
Powers on/off a virtual machine specified by it's name.
virtual_machine
vim.VirtualMachine object to power on/off virtual machine
action
Operation option to power on/off the machine
'''
if action == 'on':
try:
... | def power_cycle_vm(virtual_machine, action='on'):
'''
Powers on/off a virtual machine specified by it's name.
virtual_machine
vim.VirtualMachine object to power on/off virtual machine
action
Operation option to power on/off the machine
'''
if action == 'on':
try:
... | [
"Powers",
"on",
"/",
"off",
"a",
"virtual",
"machine",
"specified",
"by",
"it",
"s",
"name",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3475-L3523 | [
"def",
"power_cycle_vm",
"(",
"virtual_machine",
",",
"action",
"=",
"'on'",
")",
":",
"if",
"action",
"==",
"'on'",
":",
"try",
":",
"task",
"=",
"virtual_machine",
".",
"PowerOn",
"(",
")",
"task_name",
"=",
"'power on'",
"except",
"vim",
".",
"fault",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_vm | Creates virtual machine from config spec
vm_name
Virtual machine name to be created
vm_config_spec
Virtual Machine Config Spec object
folder_object
vm Folder managed object reference
resourcepool_object
Resource pool object where the machine will be created
host_... | salt/utils/vmware.py | def create_vm(vm_name, vm_config_spec, folder_object, resourcepool_object, host_object=None):
'''
Creates virtual machine from config spec
vm_name
Virtual machine name to be created
vm_config_spec
Virtual Machine Config Spec object
folder_object
vm Folder managed object re... | def create_vm(vm_name, vm_config_spec, folder_object, resourcepool_object, host_object=None):
'''
Creates virtual machine from config spec
vm_name
Virtual machine name to be created
vm_config_spec
Virtual Machine Config Spec object
folder_object
vm Folder managed object re... | [
"Creates",
"virtual",
"machine",
"from",
"config",
"spec"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3526-L3568 | [
"def",
"create_vm",
"(",
"vm_name",
",",
"vm_config_spec",
",",
"folder_object",
",",
"resourcepool_object",
",",
"host_object",
"=",
"None",
")",
":",
"try",
":",
"if",
"host_object",
"and",
"isinstance",
"(",
"host_object",
",",
"vim",
".",
"HostSystem",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | register_vm | Registers a virtual machine to the inventory with the given vmx file, on success
it returns the vim.VirtualMachine managed object reference
datacenter
Datacenter object of the virtual machine, vim.Datacenter object
name
Name of the virtual machine
vmx_path:
Full path to the vm... | salt/utils/vmware.py | def register_vm(datacenter, name, vmx_path, resourcepool_object, host_object=None):
'''
Registers a virtual machine to the inventory with the given vmx file, on success
it returns the vim.VirtualMachine managed object reference
datacenter
Datacenter object of the virtual machine, vim.Datacenter... | def register_vm(datacenter, name, vmx_path, resourcepool_object, host_object=None):
'''
Registers a virtual machine to the inventory with the given vmx file, on success
it returns the vim.VirtualMachine managed object reference
datacenter
Datacenter object of the virtual machine, vim.Datacenter... | [
"Registers",
"a",
"virtual",
"machine",
"to",
"the",
"inventory",
"with",
"the",
"given",
"vmx",
"file",
"on",
"success",
"it",
"returns",
"the",
"vim",
".",
"VirtualMachine",
"managed",
"object",
"reference"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3571-L3618 | [
"def",
"register_vm",
"(",
"datacenter",
",",
"name",
",",
"vmx_path",
",",
"resourcepool_object",
",",
"host_object",
"=",
"None",
")",
":",
"try",
":",
"if",
"host_object",
":",
"task",
"=",
"datacenter",
".",
"vmFolder",
".",
"RegisterVM_Task",
"(",
"path... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_vm | Updates the virtual machine configuration with the given object
vm_ref
Virtual machine managed object reference
vm_config_spec
Virtual machine config spec object to update | salt/utils/vmware.py | def update_vm(vm_ref, vm_config_spec):
'''
Updates the virtual machine configuration with the given object
vm_ref
Virtual machine managed object reference
vm_config_spec
Virtual machine config spec object to update
'''
vm_name = get_managed_object_name(vm_ref)
log.trace('Up... | def update_vm(vm_ref, vm_config_spec):
'''
Updates the virtual machine configuration with the given object
vm_ref
Virtual machine managed object reference
vm_config_spec
Virtual machine config spec object to update
'''
vm_name = get_managed_object_name(vm_ref)
log.trace('Up... | [
"Updates",
"the",
"virtual",
"machine",
"configuration",
"with",
"the",
"given",
"object"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3621-L3647 | [
"def",
"update_vm",
"(",
"vm_ref",
",",
"vm_config_spec",
")",
":",
"vm_name",
"=",
"get_managed_object_name",
"(",
"vm_ref",
")",
"log",
".",
"trace",
"(",
"'Updating vm \\'%s\\''",
",",
"vm_name",
")",
"try",
":",
"task",
"=",
"vm_ref",
".",
"ReconfigVM_Task... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | unregister_vm | Destroys the virtual machine
vm_ref
Managed object reference of a virtual machine object | salt/utils/vmware.py | def unregister_vm(vm_ref):
'''
Destroys the virtual machine
vm_ref
Managed object reference of a virtual machine object
'''
vm_name = get_managed_object_name(vm_ref)
log.trace('Destroying vm \'%s\'', vm_name)
try:
vm_ref.UnregisterVM()
except vim.fault.NoPermission as ex... | def unregister_vm(vm_ref):
'''
Destroys the virtual machine
vm_ref
Managed object reference of a virtual machine object
'''
vm_name = get_managed_object_name(vm_ref)
log.trace('Destroying vm \'%s\'', vm_name)
try:
vm_ref.UnregisterVM()
except vim.fault.NoPermission as ex... | [
"Destroys",
"the",
"virtual",
"machine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/vmware.py#L3675-L3694 | [
"def",
"unregister_vm",
"(",
"vm_ref",
")",
":",
"vm_name",
"=",
"get_managed_object_name",
"(",
"vm_ref",
")",
"log",
".",
"trace",
"(",
"'Destroying vm \\'%s\\''",
",",
"vm_name",
")",
"try",
":",
"vm_ref",
".",
"UnregisterVM",
"(",
")",
"except",
"vim",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | auth | Returns True if the given user cert (password is the cert contents)
was issued by the CA and if cert's Common Name is equal to username.
Returns False otherwise.
``username``: we need it to run the auth function from CLI/API;
it should be in master config auth/acl
``password``: conte... | salt/auth/pki.py | def auth(username, password, **kwargs):
'''
Returns True if the given user cert (password is the cert contents)
was issued by the CA and if cert's Common Name is equal to username.
Returns False otherwise.
``username``: we need it to run the auth function from CLI/API;
it should ... | def auth(username, password, **kwargs):
'''
Returns True if the given user cert (password is the cert contents)
was issued by the CA and if cert's Common Name is equal to username.
Returns False otherwise.
``username``: we need it to run the auth function from CLI/API;
it should ... | [
"Returns",
"True",
"if",
"the",
"given",
"user",
"cert",
"(",
"password",
"is",
"the",
"cert",
"contents",
")",
"was",
"issued",
"by",
"the",
"CA",
"and",
"if",
"cert",
"s",
"Common",
"Name",
"is",
"equal",
"to",
"username",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/pki.py#L55-L145 | [
"def",
"auth",
"(",
"username",
",",
"password",
",",
"*",
"*",
"kwargs",
")",
":",
"pem",
"=",
"password",
"cacert_file",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'external_auth:pki:ca_file'",
")",
"log",
".",
"debug",
"(",
"'Attempting to authenticat... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RecursiveDictDiffer._get_diffs | Returns a dict with the differences between dict1 and dict2
Notes:
Keys that only exist in dict2 are not included in the diff if
ignore_missing_keys is True, otherwise they are
Simple compares are done on lists | salt/utils/dictdiffer.py | def _get_diffs(cls, dict1, dict2, ignore_missing_keys):
'''
Returns a dict with the differences between dict1 and dict2
Notes:
Keys that only exist in dict2 are not included in the diff if
ignore_missing_keys is True, otherwise they are
Simple compares are do... | def _get_diffs(cls, dict1, dict2, ignore_missing_keys):
'''
Returns a dict with the differences between dict1 and dict2
Notes:
Keys that only exist in dict2 are not included in the diff if
ignore_missing_keys is True, otherwise they are
Simple compares are do... | [
"Returns",
"a",
"dict",
"with",
"the",
"differences",
"between",
"dict1",
"and",
"dict2"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L166-L192 | [
"def",
"_get_diffs",
"(",
"cls",
",",
"dict1",
",",
"dict2",
",",
"ignore_missing_keys",
")",
":",
"ret_dict",
"=",
"{",
"}",
"for",
"p",
"in",
"dict1",
".",
"keys",
"(",
")",
":",
"if",
"p",
"not",
"in",
"dict2",
":",
"ret_dict",
".",
"update",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RecursiveDictDiffer._get_values | Returns a dictionaries with the 'new' values in a diff dict.
type
Which values to return, 'new' or 'old' | salt/utils/dictdiffer.py | def _get_values(cls, diff_dict, type='new'):
'''
Returns a dictionaries with the 'new' values in a diff dict.
type
Which values to return, 'new' or 'old'
'''
ret_dict = {}
for p in diff_dict.keys():
if type in diff_dict[p].keys():
... | def _get_values(cls, diff_dict, type='new'):
'''
Returns a dictionaries with the 'new' values in a diff dict.
type
Which values to return, 'new' or 'old'
'''
ret_dict = {}
for p in diff_dict.keys():
if type in diff_dict[p].keys():
... | [
"Returns",
"a",
"dictionaries",
"with",
"the",
"new",
"values",
"in",
"a",
"diff",
"dict",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L195-L209 | [
"def",
"_get_values",
"(",
"cls",
",",
"diff_dict",
",",
"type",
"=",
"'new'",
")",
":",
"ret_dict",
"=",
"{",
"}",
"for",
"p",
"in",
"diff_dict",
".",
"keys",
"(",
")",
":",
"if",
"type",
"in",
"diff_dict",
"[",
"p",
"]",
".",
"keys",
"(",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RecursiveDictDiffer._get_changes | Returns a list of string message with the differences in a diff dict.
Each inner difference is tabulated two space deeper | salt/utils/dictdiffer.py | def _get_changes(cls, diff_dict):
'''
Returns a list of string message with the differences in a diff dict.
Each inner difference is tabulated two space deeper
'''
changes_strings = []
for p in sorted(diff_dict.keys()):
if sorted(diff_dict[p].keys()) == ['new... | def _get_changes(cls, diff_dict):
'''
Returns a list of string message with the differences in a diff dict.
Each inner difference is tabulated two space deeper
'''
changes_strings = []
for p in sorted(diff_dict.keys()):
if sorted(diff_dict[p].keys()) == ['new... | [
"Returns",
"a",
"list",
"of",
"string",
"message",
"with",
"the",
"differences",
"in",
"a",
"diff",
"dict",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L212-L245 | [
"def",
"_get_changes",
"(",
"cls",
",",
"diff_dict",
")",
":",
"changes_strings",
"=",
"[",
"]",
"for",
"p",
"in",
"sorted",
"(",
"diff_dict",
".",
"keys",
"(",
")",
")",
":",
"if",
"sorted",
"(",
"diff_dict",
"[",
"p",
"]",
".",
"keys",
"(",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RecursiveDictDiffer.added | Returns all keys that have been added.
If the keys are in child dictionaries they will be represented with
. notation | salt/utils/dictdiffer.py | def added(self):
'''
Returns all keys that have been added.
If the keys are in child dictionaries they will be represented with
. notation
'''
def _added(diffs, prefix):
keys = []
for key in diffs.keys():
if isinstance(diffs[key], ... | def added(self):
'''
Returns all keys that have been added.
If the keys are in child dictionaries they will be represented with
. notation
'''
def _added(diffs, prefix):
keys = []
for key in diffs.keys():
if isinstance(diffs[key], ... | [
"Returns",
"all",
"keys",
"that",
"have",
"been",
"added",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L247-L269 | [
"def",
"added",
"(",
"self",
")",
":",
"def",
"_added",
"(",
"diffs",
",",
"prefix",
")",
":",
"keys",
"=",
"[",
"]",
"for",
"key",
"in",
"diffs",
".",
"keys",
"(",
")",
":",
"if",
"isinstance",
"(",
"diffs",
"[",
"key",
"]",
",",
"dict",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RecursiveDictDiffer.removed | Returns all keys that have been removed.
If the keys are in child dictionaries they will be represented with
. notation | salt/utils/dictdiffer.py | def removed(self):
'''
Returns all keys that have been removed.
If the keys are in child dictionaries they will be represented with
. notation
'''
def _removed(diffs, prefix):
keys = []
for key in diffs.keys():
if isinstance(diffs[... | def removed(self):
'''
Returns all keys that have been removed.
If the keys are in child dictionaries they will be represented with
. notation
'''
def _removed(diffs, prefix):
keys = []
for key in diffs.keys():
if isinstance(diffs[... | [
"Returns",
"all",
"keys",
"that",
"have",
"been",
"removed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L271-L292 | [
"def",
"removed",
"(",
"self",
")",
":",
"def",
"_removed",
"(",
"diffs",
",",
"prefix",
")",
":",
"keys",
"=",
"[",
"]",
"for",
"key",
"in",
"diffs",
".",
"keys",
"(",
")",
":",
"if",
"isinstance",
"(",
"diffs",
"[",
"key",
"]",
",",
"dict",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RecursiveDictDiffer.changed | Returns all keys that have been changed.
If the keys are in child dictionaries they will be represented with
. notation | salt/utils/dictdiffer.py | def changed(self):
'''
Returns all keys that have been changed.
If the keys are in child dictionaries they will be represented with
. notation
'''
def _changed(diffs, prefix):
keys = []
for key in diffs.keys():
if not isinstance(di... | def changed(self):
'''
Returns all keys that have been changed.
If the keys are in child dictionaries they will be represented with
. notation
'''
def _changed(diffs, prefix):
keys = []
for key in diffs.keys():
if not isinstance(di... | [
"Returns",
"all",
"keys",
"that",
"have",
"been",
"changed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L294-L340 | [
"def",
"changed",
"(",
"self",
")",
":",
"def",
"_changed",
"(",
"diffs",
",",
"prefix",
")",
":",
"keys",
"=",
"[",
"]",
"for",
"key",
"in",
"diffs",
".",
"keys",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"diffs",
"[",
"key",
"]",
",",
"d... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | RecursiveDictDiffer.unchanged | Returns all keys that have been unchanged.
If the keys are in child dictionaries they will be represented with
. notation | salt/utils/dictdiffer.py | def unchanged(self):
'''
Returns all keys that have been unchanged.
If the keys are in child dictionaries they will be represented with
. notation
'''
def _unchanged(current_dict, diffs, prefix):
keys = []
for key in current_dict.keys():
... | def unchanged(self):
'''
Returns all keys that have been unchanged.
If the keys are in child dictionaries they will be represented with
. notation
'''
def _unchanged(current_dict, diffs, prefix):
keys = []
for key in current_dict.keys():
... | [
"Returns",
"all",
"keys",
"that",
"have",
"been",
"unchanged",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/dictdiffer.py#L342-L365 | [
"def",
"unchanged",
"(",
"self",
")",
":",
"def",
"_unchanged",
"(",
"current_dict",
",",
"diffs",
",",
"prefix",
")",
":",
"keys",
"=",
"[",
"]",
"for",
"key",
"in",
"current_dict",
".",
"keys",
"(",
")",
":",
"if",
"key",
"not",
"in",
"diffs",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_computer_object | A helper function to get the object for the local machine
Returns:
object: Returns the computer object for the local machine | salt/modules/win_groupadd.py | def _get_computer_object():
'''
A helper function to get the object for the local machine
Returns:
object: Returns the computer object for the local machine
'''
with salt.utils.winapi.Com():
nt = win32com.client.Dispatch('AdsNameSpaces')
return nt.GetObject('', 'WinNT://.,comput... | def _get_computer_object():
'''
A helper function to get the object for the local machine
Returns:
object: Returns the computer object for the local machine
'''
with salt.utils.winapi.Com():
nt = win32com.client.Dispatch('AdsNameSpaces')
return nt.GetObject('', 'WinNT://.,comput... | [
"A",
"helper",
"function",
"to",
"get",
"the",
"object",
"for",
"the",
"local",
"machine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L42-L51 | [
"def",
"_get_computer_object",
"(",
")",
":",
"with",
"salt",
".",
"utils",
".",
"winapi",
".",
"Com",
"(",
")",
":",
"nt",
"=",
"win32com",
".",
"client",
".",
"Dispatch",
"(",
"'AdsNameSpaces'",
")",
"return",
"nt",
".",
"GetObject",
"(",
"''",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_group_object | A helper function to get a specified group object
Args:
name (str): The name of the object
Returns:
object: The specified group object | salt/modules/win_groupadd.py | def _get_group_object(name):
'''
A helper function to get a specified group object
Args:
name (str): The name of the object
Returns:
object: The specified group object
'''
with salt.utils.winapi.Com():
nt = win32com.client.Dispatch('AdsNameSpaces')
return nt.GetObj... | def _get_group_object(name):
'''
A helper function to get a specified group object
Args:
name (str): The name of the object
Returns:
object: The specified group object
'''
with salt.utils.winapi.Com():
nt = win32com.client.Dispatch('AdsNameSpaces')
return nt.GetObj... | [
"A",
"helper",
"function",
"to",
"get",
"a",
"specified",
"group",
"object"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L54-L67 | [
"def",
"_get_group_object",
"(",
"name",
")",
":",
"with",
"salt",
".",
"utils",
".",
"winapi",
".",
"Com",
"(",
")",
":",
"nt",
"=",
"win32com",
".",
"client",
".",
"Dispatch",
"(",
"'AdsNameSpaces'",
")",
"return",
"nt",
".",
"GetObject",
"(",
"''",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_all_groups | A helper function that gets a list of group objects for all groups on the
machine
Returns:
iter: A list of objects for all groups on the machine | salt/modules/win_groupadd.py | def _get_all_groups():
'''
A helper function that gets a list of group objects for all groups on the
machine
Returns:
iter: A list of objects for all groups on the machine
'''
with salt.utils.winapi.Com():
nt = win32com.client.Dispatch('AdsNameSpaces')
results = nt.GetObject... | def _get_all_groups():
'''
A helper function that gets a list of group objects for all groups on the
machine
Returns:
iter: A list of objects for all groups on the machine
'''
with salt.utils.winapi.Com():
nt = win32com.client.Dispatch('AdsNameSpaces')
results = nt.GetObject... | [
"A",
"helper",
"function",
"that",
"gets",
"a",
"list",
"of",
"group",
"objects",
"for",
"all",
"groups",
"on",
"the",
"machine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L70-L82 | [
"def",
"_get_all_groups",
"(",
")",
":",
"with",
"salt",
".",
"utils",
".",
"winapi",
".",
"Com",
"(",
")",
":",
"nt",
"=",
"win32com",
".",
"client",
".",
"Dispatch",
"(",
"'AdsNameSpaces'",
")",
"results",
"=",
"nt",
".",
"GetObject",
"(",
"''",
",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add | Add the specified group
Args:
name (str):
The name of the group to add
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' group.add foo | salt/modules/win_groupadd.py | def add(name, **kwargs):
'''
Add the specified group
Args:
name (str):
The name of the group to add
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' group.add foo
'''
if not info(name):
... | def add(name, **kwargs):
'''
Add the specified group
Args:
name (str):
The name of the group to add
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' group.add foo
'''
if not info(name):
... | [
"Add",
"the",
"specified",
"group"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L96-L128 | [
"def",
"add",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"info",
"(",
"name",
")",
":",
"comp_obj",
"=",
"_get_computer_object",
"(",
")",
"try",
":",
"new_group",
"=",
"comp_obj",
".",
"Create",
"(",
"'group'",
",",
"name",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Remove the named group
Args:
name (str):
The name of the group to remove
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' group.delete foo | salt/modules/win_groupadd.py | def delete(name, **kwargs):
'''
Remove the named group
Args:
name (str):
The name of the group to remove
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' group.delete foo
'''
if info(name):
... | def delete(name, **kwargs):
'''
Remove the named group
Args:
name (str):
The name of the group to remove
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' group.delete foo
'''
if info(name):
... | [
"Remove",
"the",
"named",
"group"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L131-L163 | [
"def",
"delete",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"info",
"(",
"name",
")",
":",
"comp_obj",
"=",
"_get_computer_object",
"(",
")",
"try",
":",
"comp_obj",
".",
"Delete",
"(",
"'group'",
",",
"name",
")",
"log",
".",
"info",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | info | Return information about a group
Args:
name (str):
The name of the group for which to get information
Returns:
dict: A dictionary of information about the group
CLI Example:
.. code-block:: bash
salt '*' group.info foo | salt/modules/win_groupadd.py | def info(name):
'''
Return information about a group
Args:
name (str):
The name of the group for which to get information
Returns:
dict: A dictionary of information about the group
CLI Example:
.. code-block:: bash
salt '*' group.info foo
'''
try... | def info(name):
'''
Return information about a group
Args:
name (str):
The name of the group for which to get information
Returns:
dict: A dictionary of information about the group
CLI Example:
.. code-block:: bash
salt '*' group.info foo
'''
try... | [
"Return",
"information",
"about",
"a",
"group"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L166-L200 | [
"def",
"info",
"(",
"name",
")",
":",
"try",
":",
"groupObj",
"=",
"_get_group_object",
"(",
"name",
")",
"gr_name",
"=",
"groupObj",
".",
"Name",
"gr_mem",
"=",
"[",
"_get_username",
"(",
"x",
")",
"for",
"x",
"in",
"groupObj",
".",
"members",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | getent | Return info on all groups
Args:
refresh (bool):
Refresh the info for all groups in ``__context__``. If False only
the groups in ``__context__`` will be returned. If True the
``__context__`` will be refreshed with current data and returned.
Default is False
... | salt/modules/win_groupadd.py | def getent(refresh=False):
'''
Return info on all groups
Args:
refresh (bool):
Refresh the info for all groups in ``__context__``. If False only
the groups in ``__context__`` will be returned. If True the
``__context__`` will be refreshed with current data and r... | def getent(refresh=False):
'''
Return info on all groups
Args:
refresh (bool):
Refresh the info for all groups in ``__context__``. If False only
the groups in ``__context__`` will be returned. If True the
``__context__`` will be refreshed with current data and r... | [
"Return",
"info",
"on",
"all",
"groups"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L203-L238 | [
"def",
"getent",
"(",
"refresh",
"=",
"False",
")",
":",
"if",
"'group.getent'",
"in",
"__context__",
"and",
"not",
"refresh",
":",
"return",
"__context__",
"[",
"'group.getent'",
"]",
"ret",
"=",
"[",
"]",
"results",
"=",
"_get_all_groups",
"(",
")",
"for... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | adduser | Add a user to a group
Args:
name (str):
The name of the group to modify
username (str):
The name of the user to add to the group
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' group.addu... | salt/modules/win_groupadd.py | def adduser(name, username, **kwargs):
'''
Add a user to a group
Args:
name (str):
The name of the group to modify
username (str):
The name of the user to add to the group
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
... | def adduser(name, username, **kwargs):
'''
Add a user to a group
Args:
name (str):
The name of the group to modify
username (str):
The name of the user to add to the group
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
... | [
"Add",
"a",
"user",
"to",
"a",
"group"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L241-L286 | [
"def",
"adduser",
"(",
"name",
",",
"username",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"group_obj",
"=",
"_get_group_object",
"(",
"name",
")",
"except",
"pywintypes",
".",
"com_error",
"as",
"exc",
":",
"msg",
"=",
"'Failed to access group {0}. {1}'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | members | Ensure a group contains only the members in the list
Args:
name (str):
The name of the group to modify
members_list (str):
A single user or a comma separated list of users. The group will
contain only the users specified in this list.
Returns:
bool... | salt/modules/win_groupadd.py | def members(name, members_list, **kwargs):
'''
Ensure a group contains only the members in the list
Args:
name (str):
The name of the group to modify
members_list (str):
A single user or a comma separated list of users. The group will
contain only the u... | def members(name, members_list, **kwargs):
'''
Ensure a group contains only the members in the list
Args:
name (str):
The name of the group to modify
members_list (str):
A single user or a comma separated list of users. The group will
contain only the u... | [
"Ensure",
"a",
"group",
"contains",
"only",
"the",
"members",
"in",
"the",
"list"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L336-L405 | [
"def",
"members",
"(",
"name",
",",
"members_list",
",",
"*",
"*",
"kwargs",
")",
":",
"members_list",
"=",
"[",
"salt",
".",
"utils",
".",
"win_functions",
".",
"get_sam_name",
"(",
"m",
")",
"for",
"m",
"in",
"members_list",
".",
"split",
"(",
"\",\"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_groups | Return a list of groups
Args:
refresh (bool):
Refresh the info for all groups in ``__context__``. If False only
the groups in ``__context__`` will be returned. If True, the
``__context__`` will be refreshed with current data and returned.
Default is False
... | salt/modules/win_groupadd.py | def list_groups(refresh=False):
'''
Return a list of groups
Args:
refresh (bool):
Refresh the info for all groups in ``__context__``. If False only
the groups in ``__context__`` will be returned. If True, the
``__context__`` will be refreshed with current data a... | def list_groups(refresh=False):
'''
Return a list of groups
Args:
refresh (bool):
Refresh the info for all groups in ``__context__``. If False only
the groups in ``__context__`` will be returned. If True, the
``__context__`` will be refreshed with current data a... | [
"Return",
"a",
"list",
"of",
"groups"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_groupadd.py#L408-L441 | [
"def",
"list_groups",
"(",
"refresh",
"=",
"False",
")",
":",
"if",
"'group.list_groups'",
"in",
"__context__",
"and",
"not",
"refresh",
":",
"return",
"__context__",
"[",
"'group.list_groups'",
"]",
"results",
"=",
"_get_all_groups",
"(",
")",
"ret",
"=",
"["... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | identical_signature_wrapper | Return a function with identical signature as ``original_function``'s which
will call the ``wrapped_function``. | salt/utils/decorators/signature.py | def identical_signature_wrapper(original_function, wrapped_function):
'''
Return a function with identical signature as ``original_function``'s which
will call the ``wrapped_function``.
'''
context = {'__wrapped__': wrapped_function}
function_def = compile(
'def {0}({1}):\n'
' ... | def identical_signature_wrapper(original_function, wrapped_function):
'''
Return a function with identical signature as ``original_function``'s which
will call the ``wrapped_function``.
'''
context = {'__wrapped__': wrapped_function}
function_def = compile(
'def {0}({1}):\n'
' ... | [
"Return",
"a",
"function",
"with",
"identical",
"signature",
"as",
"original_function",
"s",
"which",
"will",
"call",
"the",
"wrapped_function",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/decorators/signature.py#L18-L43 | [
"def",
"identical_signature_wrapper",
"(",
"original_function",
",",
"wrapped_function",
")",
":",
"context",
"=",
"{",
"'__wrapped__'",
":",
"wrapped_function",
"}",
"function_def",
"=",
"compile",
"(",
"'def {0}({1}):\\n'",
"' return __wrapped__({2})'",
".",
"format"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _stdout_list_split | Evaulates Open vSwitch command`s retcode value.
Args:
retcode: Value of retcode field from response, should be 0, 1 or 2.
stdout: Value of stdout filed from response.
splitstring: String used to split the stdout default new line.
Returns:
List or False. | salt/modules/openvswitch.py | def _stdout_list_split(retcode, stdout='', splitstring='\n'):
'''
Evaulates Open vSwitch command`s retcode value.
Args:
retcode: Value of retcode field from response, should be 0, 1 or 2.
stdout: Value of stdout filed from response.
splitstring: String used to split the stdout defau... | def _stdout_list_split(retcode, stdout='', splitstring='\n'):
'''
Evaulates Open vSwitch command`s retcode value.
Args:
retcode: Value of retcode field from response, should be 0, 1 or 2.
stdout: Value of stdout filed from response.
splitstring: String used to split the stdout defau... | [
"Evaulates",
"Open",
"vSwitch",
"command",
"s",
"retcode",
"value",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L80-L96 | [
"def",
"_stdout_list_split",
"(",
"retcode",
",",
"stdout",
"=",
"''",
",",
"splitstring",
"=",
"'\\n'",
")",
":",
"if",
"retcode",
"==",
"0",
":",
"ret",
"=",
"stdout",
".",
"split",
"(",
"splitstring",
")",
"return",
"ret",
"else",
":",
"return",
"Fa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _convert_json | Converts from the JSON output provided by ovs-vsctl into a usable Python
object tree. In particular, sets and maps are converted from lists to
actual sets or maps.
Args:
obj: Object that shall be recursively converted.
Returns:
Converted version of object. | salt/modules/openvswitch.py | def _convert_json(obj):
'''
Converts from the JSON output provided by ovs-vsctl into a usable Python
object tree. In particular, sets and maps are converted from lists to
actual sets or maps.
Args:
obj: Object that shall be recursively converted.
Returns:
Converted version of o... | def _convert_json(obj):
'''
Converts from the JSON output provided by ovs-vsctl into a usable Python
object tree. In particular, sets and maps are converted from lists to
actual sets or maps.
Args:
obj: Object that shall be recursively converted.
Returns:
Converted version of o... | [
"Converts",
"from",
"the",
"JSON",
"output",
"provided",
"by",
"ovs",
"-",
"vsctl",
"into",
"a",
"usable",
"Python",
"object",
"tree",
".",
"In",
"particular",
"sets",
"and",
"maps",
"are",
"converted",
"from",
"lists",
"to",
"actual",
"sets",
"or",
"maps"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L99-L129 | [
"def",
"_convert_json",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"dict",
")",
":",
"return",
"{",
"_convert_json",
"(",
"key",
")",
":",
"_convert_json",
"(",
"val",
")",
"for",
"(",
"key",
",",
"val",
")",
"in",
"six",
".",
"iter... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | bridge_list | Lists all existing real and fake bridges.
Returns:
List of bridges (or empty list), False on failure.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.bridge_list | salt/modules/openvswitch.py | def bridge_list():
'''
Lists all existing real and fake bridges.
Returns:
List of bridges (or empty list), False on failure.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.bridge_list
'''
cmd = 'ovs-vsctl list-br'
result = __salt... | def bridge_list():
'''
Lists all existing real and fake bridges.
Returns:
List of bridges (or empty list), False on failure.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.bridge_list
'''
cmd = 'ovs-vsctl list-br'
result = __salt... | [
"Lists",
"all",
"existing",
"real",
"and",
"fake",
"bridges",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L147-L165 | [
"def",
"bridge_list",
"(",
")",
":",
"cmd",
"=",
"'ovs-vsctl list-br'",
"result",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"retcode",
"=",
"result",
"[",
"'retcode'",
"]",
"stdout",
"=",
"result",
"[",
"'stdout'",
"]",
"return",
"_stdou... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | bridge_exists | Tests whether bridge exists as a real or fake bridge.
Returns:
True if Bridge exists, else False.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.bridge_exists br0 | salt/modules/openvswitch.py | def bridge_exists(br):
'''
Tests whether bridge exists as a real or fake bridge.
Returns:
True if Bridge exists, else False.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.bridge_exists br0
'''
cmd = 'ovs-vsctl br-exists {0}'.format... | def bridge_exists(br):
'''
Tests whether bridge exists as a real or fake bridge.
Returns:
True if Bridge exists, else False.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.bridge_exists br0
'''
cmd = 'ovs-vsctl br-exists {0}'.format... | [
"Tests",
"whether",
"bridge",
"exists",
"as",
"a",
"real",
"or",
"fake",
"bridge",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L168-L185 | [
"def",
"bridge_exists",
"(",
"br",
")",
":",
"cmd",
"=",
"'ovs-vsctl br-exists {0}'",
".",
"format",
"(",
"br",
")",
"result",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"retcode",
"=",
"result",
"[",
"'retcode'",
"]",
"return",
"_retcode... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | bridge_create | Creates a new bridge.
Args:
br: A string - bridge name
may_exist: Bool, if False - attempting to create a bridge that exists returns False.
parent: String, the name of the parent bridge (if the bridge shall be
created as a fake bridge). If specified, vlan must also be
... | salt/modules/openvswitch.py | def bridge_create(br, may_exist=True, parent=None, vlan=None):
'''
Creates a new bridge.
Args:
br: A string - bridge name
may_exist: Bool, if False - attempting to create a bridge that exists returns False.
parent: String, the name of the parent bridge (if the bridge shall be
... | def bridge_create(br, may_exist=True, parent=None, vlan=None):
'''
Creates a new bridge.
Args:
br: A string - bridge name
may_exist: Bool, if False - attempting to create a bridge that exists returns False.
parent: String, the name of the parent bridge (if the bridge shall be
... | [
"Creates",
"a",
"new",
"bridge",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L188-L223 | [
"def",
"bridge_create",
"(",
"br",
",",
"may_exist",
"=",
"True",
",",
"parent",
"=",
"None",
",",
"vlan",
"=",
"None",
")",
":",
"param_may_exist",
"=",
"_param_may_exist",
"(",
"may_exist",
")",
"if",
"parent",
"is",
"not",
"None",
"and",
"vlan",
"is",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | bridge_delete | Deletes bridge and all of its ports.
Args:
br: A string - bridge name
if_exists: Bool, if False - attempting to delete a bridge that does not exist returns False.
Returns:
True on success, else False.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
... | salt/modules/openvswitch.py | def bridge_delete(br, if_exists=True):
'''
Deletes bridge and all of its ports.
Args:
br: A string - bridge name
if_exists: Bool, if False - attempting to delete a bridge that does not exist returns False.
Returns:
True on success, else False.
.. versionadded:: 2016.3.0
... | def bridge_delete(br, if_exists=True):
'''
Deletes bridge and all of its ports.
Args:
br: A string - bridge name
if_exists: Bool, if False - attempting to delete a bridge that does not exist returns False.
Returns:
True on success, else False.
.. versionadded:: 2016.3.0
... | [
"Deletes",
"bridge",
"and",
"all",
"of",
"its",
"ports",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L226-L248 | [
"def",
"bridge_delete",
"(",
"br",
",",
"if_exists",
"=",
"True",
")",
":",
"param_if_exists",
"=",
"_param_if_exists",
"(",
"if_exists",
")",
"cmd",
"=",
"'ovs-vsctl {1}del-br {0}'",
".",
"format",
"(",
"br",
",",
"param_if_exists",
")",
"result",
"=",
"__sal... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | bridge_to_parent | Returns the parent bridge of a bridge.
Args:
br: A string - bridge name
Returns:
Name of the parent bridge. This is the same as the bridge name if the
bridge is not a fake bridge. If the bridge does not exist, False is
returned.
CLI Example:
.. code-block:: bash
... | salt/modules/openvswitch.py | def bridge_to_parent(br):
'''
Returns the parent bridge of a bridge.
Args:
br: A string - bridge name
Returns:
Name of the parent bridge. This is the same as the bridge name if the
bridge is not a fake bridge. If the bridge does not exist, False is
returned.
CLI Ex... | def bridge_to_parent(br):
'''
Returns the parent bridge of a bridge.
Args:
br: A string - bridge name
Returns:
Name of the parent bridge. This is the same as the bridge name if the
bridge is not a fake bridge. If the bridge does not exist, False is
returned.
CLI Ex... | [
"Returns",
"the",
"parent",
"bridge",
"of",
"a",
"bridge",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L251-L274 | [
"def",
"bridge_to_parent",
"(",
"br",
")",
":",
"cmd",
"=",
"'ovs-vsctl br-to-parent {0}'",
".",
"format",
"(",
"br",
")",
"result",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"if",
"result",
"[",
"'retcode'",
"]",
"!=",
"0",
":",
"retu... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | bridge_to_vlan | Returns the VLAN ID of a bridge.
Args:
br: A string - bridge name
Returns:
VLAN ID of the bridge. The VLAN ID is 0 if the bridge is not a fake
bridge. If the bridge does not exist, False is returned.
CLI Example:
.. code-block:: bash
salt '*' openvswitch.bridge_to_p... | salt/modules/openvswitch.py | def bridge_to_vlan(br):
'''
Returns the VLAN ID of a bridge.
Args:
br: A string - bridge name
Returns:
VLAN ID of the bridge. The VLAN ID is 0 if the bridge is not a fake
bridge. If the bridge does not exist, False is returned.
CLI Example:
.. code-block:: bash
... | def bridge_to_vlan(br):
'''
Returns the VLAN ID of a bridge.
Args:
br: A string - bridge name
Returns:
VLAN ID of the bridge. The VLAN ID is 0 if the bridge is not a fake
bridge. If the bridge does not exist, False is returned.
CLI Example:
.. code-block:: bash
... | [
"Returns",
"the",
"VLAN",
"ID",
"of",
"a",
"bridge",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L277-L298 | [
"def",
"bridge_to_vlan",
"(",
"br",
")",
":",
"cmd",
"=",
"'ovs-vsctl br-to-vlan {0}'",
".",
"format",
"(",
"br",
")",
"result",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"if",
"result",
"[",
"'retcode'",
"]",
"!=",
"0",
":",
"return",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | port_add | Creates on bridge a new port named port.
Returns:
True on success, else False.
Args:
br: A string - bridge name
port: A string - port name
may_exist: Bool, if False - attempting to create a port that exists returns False.
internal: A boolean to create an internal interf... | salt/modules/openvswitch.py | def port_add(br, port, may_exist=False, internal=False):
'''
Creates on bridge a new port named port.
Returns:
True on success, else False.
Args:
br: A string - bridge name
port: A string - port name
may_exist: Bool, if False - attempting to create a port that exists re... | def port_add(br, port, may_exist=False, internal=False):
'''
Creates on bridge a new port named port.
Returns:
True on success, else False.
Args:
br: A string - bridge name
port: A string - port name
may_exist: Bool, if False - attempting to create a port that exists re... | [
"Creates",
"on",
"bridge",
"a",
"new",
"port",
"named",
"port",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L301-L327 | [
"def",
"port_add",
"(",
"br",
",",
"port",
",",
"may_exist",
"=",
"False",
",",
"internal",
"=",
"False",
")",
":",
"param_may_exist",
"=",
"_param_may_exist",
"(",
"may_exist",
")",
"cmd",
"=",
"'ovs-vsctl {2}add-port {0} {1}'",
".",
"format",
"(",
"br",
",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | port_remove | Deletes port.
Args:
br: A string - bridge name (If bridge is None, port is removed from whatever bridge contains it)
port: A string - port name.
if_exists: Bool, if False - attempting to delete a por that does not exist returns False. (Default True)
Returns:
True on success,... | salt/modules/openvswitch.py | def port_remove(br, port, if_exists=True):
'''
Deletes port.
Args:
br: A string - bridge name (If bridge is None, port is removed from whatever bridge contains it)
port: A string - port name.
if_exists: Bool, if False - attempting to delete a por that does not exist returns Fals... | def port_remove(br, port, if_exists=True):
'''
Deletes port.
Args:
br: A string - bridge name (If bridge is None, port is removed from whatever bridge contains it)
port: A string - port name.
if_exists: Bool, if False - attempting to delete a por that does not exist returns Fals... | [
"Deletes",
"port",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L330-L357 | [
"def",
"port_remove",
"(",
"br",
",",
"port",
",",
"if_exists",
"=",
"True",
")",
":",
"param_if_exists",
"=",
"_param_if_exists",
"(",
"if_exists",
")",
"if",
"port",
"and",
"not",
"br",
":",
"cmd",
"=",
"'ovs-vsctl {1}del-port {0}'",
".",
"format",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | port_list | Lists all of the ports within bridge.
Args:
br: A string - bridge name.
Returns:
List of bridges (or empty list), False on failure.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.port_list br0 | salt/modules/openvswitch.py | def port_list(br):
'''
Lists all of the ports within bridge.
Args:
br: A string - bridge name.
Returns:
List of bridges (or empty list), False on failure.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.port_list br0
'''
... | def port_list(br):
'''
Lists all of the ports within bridge.
Args:
br: A string - bridge name.
Returns:
List of bridges (or empty list), False on failure.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.port_list br0
'''
... | [
"Lists",
"all",
"of",
"the",
"ports",
"within",
"bridge",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L360-L381 | [
"def",
"port_list",
"(",
"br",
")",
":",
"cmd",
"=",
"'ovs-vsctl list-ports {0}'",
".",
"format",
"(",
"br",
")",
"result",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"retcode",
"=",
"result",
"[",
"'retcode'",
"]",
"stdout",
"=",
"resu... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | port_get_tag | Lists tags of the port.
Args:
port: A string - port name.
Returns:
List of tags (or empty list), False on failure.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.port_get_tag tap0 | salt/modules/openvswitch.py | def port_get_tag(port):
'''
Lists tags of the port.
Args:
port: A string - port name.
Returns:
List of tags (or empty list), False on failure.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.port_get_tag tap0
'''
cmd = 'o... | def port_get_tag(port):
'''
Lists tags of the port.
Args:
port: A string - port name.
Returns:
List of tags (or empty list), False on failure.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' openvswitch.port_get_tag tap0
'''
cmd = 'o... | [
"Lists",
"tags",
"of",
"the",
"port",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L384-L405 | [
"def",
"port_get_tag",
"(",
"port",
")",
":",
"cmd",
"=",
"'ovs-vsctl get port {0} tag'",
".",
"format",
"(",
"port",
")",
"result",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"retcode",
"=",
"result",
"[",
"'retcode'",
"]",
"stdout",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | port_create_vlan | Isolate VM traffic using VLANs.
Args:
br: A string - bridge name.
port: A string - port name.
id: An integer in the valid range 0 to 4095 (inclusive), name of VLAN.
internal: A boolean to create an internal interface if one does not exist.
Returns:
True on success, else... | salt/modules/openvswitch.py | def port_create_vlan(br, port, id, internal=False):
'''
Isolate VM traffic using VLANs.
Args:
br: A string - bridge name.
port: A string - port name.
id: An integer in the valid range 0 to 4095 (inclusive), name of VLAN.
internal: A boolean to create an internal interface if... | def port_create_vlan(br, port, id, internal=False):
'''
Isolate VM traffic using VLANs.
Args:
br: A string - bridge name.
port: A string - port name.
id: An integer in the valid range 0 to 4095 (inclusive), name of VLAN.
internal: A boolean to create an internal interface if... | [
"Isolate",
"VM",
"traffic",
"using",
"VLANs",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L456-L494 | [
"def",
"port_create_vlan",
"(",
"br",
",",
"port",
",",
"id",
",",
"internal",
"=",
"False",
")",
":",
"interfaces",
"=",
"__salt__",
"[",
"'network.interfaces'",
"]",
"(",
")",
"if",
"not",
"0",
"<=",
"id",
"<=",
"4095",
":",
"return",
"False",
"elif"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | port_create_gre | Generic Routing Encapsulation - creates GRE tunnel between endpoints.
Args:
br: A string - bridge name.
port: A string - port name.
id: An integer - unsigned 32-bit number, tunnel's key.
remote: A string - remote endpoint's IP address.
Returns:
True on success, else Fal... | salt/modules/openvswitch.py | def port_create_gre(br, port, id, remote):
'''
Generic Routing Encapsulation - creates GRE tunnel between endpoints.
Args:
br: A string - bridge name.
port: A string - port name.
id: An integer - unsigned 32-bit number, tunnel's key.
remote: A string - remote endpoint's IP a... | def port_create_gre(br, port, id, remote):
'''
Generic Routing Encapsulation - creates GRE tunnel between endpoints.
Args:
br: A string - bridge name.
port: A string - port name.
id: An integer - unsigned 32-bit number, tunnel's key.
remote: A string - remote endpoint's IP a... | [
"Generic",
"Routing",
"Encapsulation",
"-",
"creates",
"GRE",
"tunnel",
"between",
"endpoints",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L497-L531 | [
"def",
"port_create_gre",
"(",
"br",
",",
"port",
",",
"id",
",",
"remote",
")",
":",
"if",
"not",
"0",
"<=",
"id",
"<",
"2",
"**",
"32",
":",
"return",
"False",
"elif",
"not",
"__salt__",
"[",
"'dig.check_ip'",
"]",
"(",
"remote",
")",
":",
"retur... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | port_create_vxlan | Virtual eXtensible Local Area Network - creates VXLAN tunnel between endpoints.
Args:
br: A string - bridge name.
port: A string - port name.
id: An integer - unsigned 64-bit number, tunnel's key.
remote: A string - remote endpoint's IP address.
dst_port: An integer - port t... | salt/modules/openvswitch.py | def port_create_vxlan(br, port, id, remote, dst_port=None):
'''
Virtual eXtensible Local Area Network - creates VXLAN tunnel between endpoints.
Args:
br: A string - bridge name.
port: A string - port name.
id: An integer - unsigned 64-bit number, tunnel's key.
remote: A stri... | def port_create_vxlan(br, port, id, remote, dst_port=None):
'''
Virtual eXtensible Local Area Network - creates VXLAN tunnel between endpoints.
Args:
br: A string - bridge name.
port: A string - port name.
id: An integer - unsigned 64-bit number, tunnel's key.
remote: A stri... | [
"Virtual",
"eXtensible",
"Local",
"Area",
"Network",
"-",
"creates",
"VXLAN",
"tunnel",
"between",
"endpoints",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L534-L571 | [
"def",
"port_create_vxlan",
"(",
"br",
",",
"port",
",",
"id",
",",
"remote",
",",
"dst_port",
"=",
"None",
")",
":",
"dst_port",
"=",
"' options:dst_port='",
"+",
"six",
".",
"text_type",
"(",
"dst_port",
")",
"if",
"0",
"<",
"dst_port",
"<=",
"65535",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | db_get | Gets a column's value for a specific record.
Args:
table: A string - name of the database table.
record: A string - identifier of the record.
column: A string - name of the column.
if_exists: A boolean - if True, it is not an error if the record does
not exist.
Retu... | salt/modules/openvswitch.py | def db_get(table, record, column, if_exists=False):
'''
Gets a column's value for a specific record.
Args:
table: A string - name of the database table.
record: A string - identifier of the record.
column: A string - name of the column.
if_exists: A boolean - if True, it is ... | def db_get(table, record, column, if_exists=False):
'''
Gets a column's value for a specific record.
Args:
table: A string - name of the database table.
record: A string - identifier of the record.
column: A string - name of the column.
if_exists: A boolean - if True, it is ... | [
"Gets",
"a",
"column",
"s",
"value",
"for",
"a",
"specific",
"record",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L574-L604 | [
"def",
"db_get",
"(",
"table",
",",
"record",
",",
"column",
",",
"if_exists",
"=",
"False",
")",
":",
"cmd",
"=",
"[",
"'ovs-vsctl'",
",",
"'--format=json'",
",",
"'--columns={0}'",
".",
"format",
"(",
"column",
")",
"]",
"if",
"if_exists",
":",
"cmd",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | db_set | Sets a column's value for a specific record.
Args:
table: A string - name of the database table.
record: A string - identifier of the record.
column: A string - name of the column.
value: A string - the value to be set
if_exists: A boolean - if True, it is not an error if th... | salt/modules/openvswitch.py | def db_set(table, record, column, value, if_exists=False):
'''
Sets a column's value for a specific record.
Args:
table: A string - name of the database table.
record: A string - identifier of the record.
column: A string - name of the column.
value: A string - the value to ... | def db_set(table, record, column, value, if_exists=False):
'''
Sets a column's value for a specific record.
Args:
table: A string - name of the database table.
record: A string - identifier of the record.
column: A string - name of the column.
value: A string - the value to ... | [
"Sets",
"a",
"column",
"s",
"value",
"for",
"a",
"specific",
"record",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openvswitch.py#L607-L635 | [
"def",
"db_set",
"(",
"table",
",",
"record",
",",
"column",
",",
"value",
",",
"if_exists",
"=",
"False",
")",
":",
"cmd",
"=",
"[",
"'ovs-vsctl'",
"]",
"if",
"if_exists",
":",
"cmd",
"+=",
"[",
"'--if-exists'",
"]",
"cmd",
"+=",
"[",
"'set'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | virtual_network_present | .. versionadded:: 2019.2.0
Ensure a virtual network exists.
:param name:
Name of the virtual network.
:param resource_group:
The resource group assigned to the virtual network.
:param address_prefixes:
A list of CIDR blocks which can be used by subnets within the virtual netw... | salt/states/azurearm_network.py | def virtual_network_present(name, address_prefixes, resource_group, dns_servers=None,
tags=None, connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a virtual network exists.
:param name:
Name of the virtual network.
:param resource_group:
... | def virtual_network_present(name, address_prefixes, resource_group, dns_servers=None,
tags=None, connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a virtual network exists.
:param name:
Name of the virtual network.
:param resource_group:
... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L112-L258 | [
"def",
"virtual_network_present",
"(",
"name",
",",
"address_prefixes",
",",
"resource_group",
",",
"dns_servers",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"connection_auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | virtual_network_absent | .. versionadded:: 2019.2.0
Ensure a virtual network does not exist in the resource group.
:param name:
Name of the virtual network.
:param resource_group:
The resource group assigned to the virtual network.
:param connection_auth:
A dict with subscription and authentication p... | salt/states/azurearm_network.py | def virtual_network_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a virtual network does not exist in the resource group.
:param name:
Name of the virtual network.
:param resource_group:
The resource group assigned to the virtual network... | def virtual_network_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a virtual network does not exist in the resource group.
:param name:
Name of the virtual network.
:param resource_group:
The resource group assigned to the virtual network... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L261-L321 | [
"def",
"virtual_network_absent",
"(",
"name",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subnet_present | .. versionadded:: 2019.2.0
Ensure a subnet exists.
:param name:
Name of the subnet.
:param address_prefix:
A CIDR block used by the subnet within the virtual network.
:param virtual_network:
Name of the existing virtual network to contain the subnet.
:param resource_grou... | salt/states/azurearm_network.py | def subnet_present(name, address_prefix, virtual_network, resource_group,
security_group=None, route_table=None, connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a subnet exists.
:param name:
Name of the subnet.
:param address_prefix:
A CID... | def subnet_present(name, address_prefix, virtual_network, resource_group,
security_group=None, route_table=None, connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a subnet exists.
:param name:
Name of the subnet.
:param address_prefix:
A CID... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L324-L463 | [
"def",
"subnet_present",
"(",
"name",
",",
"address_prefix",
",",
"virtual_network",
",",
"resource_group",
",",
"security_group",
"=",
"None",
",",
"route_table",
"=",
"None",
",",
"connection_auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subnet_absent | .. versionadded:: 2019.2.0
Ensure a virtual network does not exist in the virtual network.
:param name:
Name of the subnet.
:param virtual_network:
Name of the existing virtual network containing the subnet.
:param resource_group:
The resource group assigned to the virtual ne... | salt/states/azurearm_network.py | def subnet_absent(name, virtual_network, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a virtual network does not exist in the virtual network.
:param name:
Name of the subnet.
:param virtual_network:
Name of the existing virtual network containing t... | def subnet_absent(name, virtual_network, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a virtual network does not exist in the virtual network.
:param name:
Name of the subnet.
:param virtual_network:
Name of the existing virtual network containing t... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L466-L530 | [
"def",
"subnet_absent",
"(",
"name",
",",
"virtual_network",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | network_security_group_present | .. versionadded:: 2019.2.0
Ensure a network security group exists.
:param name:
Name of the network security group.
:param resource_group:
The resource group assigned to the network security group.
:param tags:
A dictionary of strings can be passed as tag metadata to the netw... | salt/states/azurearm_network.py | def network_security_group_present(name, resource_group, tags=None, security_rules=None, connection_auth=None,
**kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a network security group exists.
:param name:
Name of the network security group.
:param resou... | def network_security_group_present(name, resource_group, tags=None, security_rules=None, connection_auth=None,
**kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a network security group exists.
:param name:
Name of the network security group.
:param resou... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L533-L671 | [
"def",
"network_security_group_present",
"(",
"name",
",",
"resource_group",
",",
"tags",
"=",
"None",
",",
"security_rules",
"=",
"None",
",",
"connection_auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | network_security_group_absent | .. versionadded:: 2019.2.0
Ensure a network security group does not exist in the resource group.
:param name:
Name of the network security group.
:param resource_group:
The resource group assigned to the network security group.
:param connection_auth:
A dict with subscription... | salt/states/azurearm_network.py | def network_security_group_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a network security group does not exist in the resource group.
:param name:
Name of the network security group.
:param resource_group:
The resource group assigned t... | def network_security_group_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a network security group does not exist in the resource group.
:param name:
Name of the network security group.
:param resource_group:
The resource group assigned t... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L674-L734 | [
"def",
"network_security_group_absent",
"(",
"name",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | security_rule_present | .. versionadded:: 2019.2.0
Ensure a security rule exists.
:param name:
Name of the security rule.
:param access:
'allow' or 'deny'
:param direction:
'inbound' or 'outbound'
:param priority:
Integer between 100 and 4096 used for ordering rule application.
:pa... | salt/states/azurearm_network.py | def security_rule_present(name, access, direction, priority, protocol, security_group, resource_group,
destination_address_prefix=None, destination_port_range=None, source_address_prefix=None,
source_port_range=None, description=None, destination_address_prefixes=None... | def security_rule_present(name, access, direction, priority, protocol, security_group, resource_group,
destination_address_prefix=None, destination_port_range=None, source_address_prefix=None,
source_port_range=None, description=None, destination_address_prefixes=None... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L737-L1052 | [
"def",
"security_rule_present",
"(",
"name",
",",
"access",
",",
"direction",
",",
"priority",
",",
"protocol",
",",
"security_group",
",",
"resource_group",
",",
"destination_address_prefix",
"=",
"None",
",",
"destination_port_range",
"=",
"None",
",",
"source_add... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | security_rule_absent | .. versionadded:: 2019.2.0
Ensure a security rule does not exist in the network security group.
:param name:
Name of the security rule.
:param security_group:
The network security group containing the security rule.
:param resource_group:
The resource group assigned to the ne... | salt/states/azurearm_network.py | def security_rule_absent(name, security_group, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a security rule does not exist in the network security group.
:param name:
Name of the security rule.
:param security_group:
The network security group conta... | def security_rule_absent(name, security_group, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a security rule does not exist in the network security group.
:param name:
Name of the security rule.
:param security_group:
The network security group conta... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L1055-L1119 | [
"def",
"security_rule_absent",
"(",
"name",
",",
"security_group",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | load_balancer_present | .. versionadded:: 2019.2.0
Ensure a load balancer exists.
:param name:
Name of the load balancer.
:param resource_group:
The resource group assigned to the load balancer.
:param sku:
The load balancer SKU, which can be 'Basic' or 'Standard'.
:param tags:
A dictio... | salt/states/azurearm_network.py | def load_balancer_present(name, resource_group, sku=None, frontend_ip_configurations=None, backend_address_pools=None,
load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None,
outbound_nat_rules=None, tags=None, connection_auth=None, **k... | def load_balancer_present(name, resource_group, sku=None, frontend_ip_configurations=None, backend_address_pools=None,
load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None,
outbound_nat_rules=None, tags=None, connection_auth=None, **k... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L1122-L1478 | [
"def",
"load_balancer_present",
"(",
"name",
",",
"resource_group",
",",
"sku",
"=",
"None",
",",
"frontend_ip_configurations",
"=",
"None",
",",
"backend_address_pools",
"=",
"None",
",",
"load_balancing_rules",
"=",
"None",
",",
"probes",
"=",
"None",
",",
"in... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | load_balancer_absent | .. versionadded:: 2019.2.0
Ensure a load balancer does not exist in the resource group.
:param name:
Name of the load balancer.
:param resource_group:
The resource group assigned to the load balancer.
:param connection_auth:
A dict with subscription and authentication paramet... | salt/states/azurearm_network.py | def load_balancer_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a load balancer does not exist in the resource group.
:param name:
Name of the load balancer.
:param resource_group:
The resource group assigned to the load balancer.
:... | def load_balancer_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a load balancer does not exist in the resource group.
:param name:
Name of the load balancer.
:param resource_group:
The resource group assigned to the load balancer.
:... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L1481-L1541 | [
"def",
"load_balancer_absent",
"(",
"name",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | public_ip_address_present | .. versionadded:: 2019.2.0
Ensure a public IP address exists.
:param name:
Name of the public IP address.
:param resource_group:
The resource group assigned to the public IP address.
:param dns_settings:
An optional dictionary representing a valid PublicIPAddressDnsSettings o... | salt/states/azurearm_network.py | def public_ip_address_present(name, resource_group, tags=None, sku=None, public_ip_allocation_method=None,
public_ip_address_version=None, dns_settings=None, idle_timeout_in_minutes=None,
connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
... | def public_ip_address_present(name, resource_group, tags=None, sku=None, public_ip_allocation_method=None,
public_ip_address_version=None, dns_settings=None, idle_timeout_in_minutes=None,
connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L1544-L1727 | [
"def",
"public_ip_address_present",
"(",
"name",
",",
"resource_group",
",",
"tags",
"=",
"None",
",",
"sku",
"=",
"None",
",",
"public_ip_allocation_method",
"=",
"None",
",",
"public_ip_address_version",
"=",
"None",
",",
"dns_settings",
"=",
"None",
",",
"idl... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | public_ip_address_absent | .. versionadded:: 2019.2.0
Ensure a public IP address does not exist in the resource group.
:param name:
Name of the public IP address.
:param resource_group:
The resource group assigned to the public IP address.
:param connection_auth:
A dict with subscription and authentica... | salt/states/azurearm_network.py | def public_ip_address_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a public IP address does not exist in the resource group.
:param name:
Name of the public IP address.
:param resource_group:
The resource group assigned to the public IP... | def public_ip_address_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a public IP address does not exist in the resource group.
:param name:
Name of the public IP address.
:param resource_group:
The resource group assigned to the public IP... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L1730-L1790 | [
"def",
"public_ip_address_absent",
"(",
"name",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | network_interface_present | .. versionadded:: 2019.2.0
Ensure a network interface exists.
:param name:
Name of the network interface.
:param ip_configurations:
A list of dictionaries representing valid NetworkInterfaceIPConfiguration objects. The 'name' key is required at
minimum. At least one IP Configurati... | salt/states/azurearm_network.py | def network_interface_present(name, ip_configurations, subnet, virtual_network, resource_group, tags=None,
virtual_machine=None, network_security_group=None, dns_settings=None, mac_address=None,
primary=None, enable_accelerated_networking=None, enable_ip_forwa... | def network_interface_present(name, ip_configurations, subnet, virtual_network, resource_group, tags=None,
virtual_machine=None, network_security_group=None, dns_settings=None, mac_address=None,
primary=None, enable_accelerated_networking=None, enable_ip_forwa... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L1793-L2047 | [
"def",
"network_interface_present",
"(",
"name",
",",
"ip_configurations",
",",
"subnet",
",",
"virtual_network",
",",
"resource_group",
",",
"tags",
"=",
"None",
",",
"virtual_machine",
"=",
"None",
",",
"network_security_group",
"=",
"None",
",",
"dns_settings",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | network_interface_absent | .. versionadded:: 2019.2.0
Ensure a network interface does not exist in the resource group.
:param name:
Name of the network interface.
:param resource_group:
The resource group assigned to the network interface.
:param connection_auth:
A dict with subscription and authentica... | salt/states/azurearm_network.py | def network_interface_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a network interface does not exist in the resource group.
:param name:
Name of the network interface.
:param resource_group:
The resource group assigned to the network i... | def network_interface_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a network interface does not exist in the resource group.
:param name:
Name of the network interface.
:param resource_group:
The resource group assigned to the network i... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L2050-L2110 | [
"def",
"network_interface_absent",
"(",
"name",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | route_table_present | .. versionadded:: 2019.2.0
Ensure a route table exists.
:param name:
Name of the route table.
:param resource_group:
The resource group assigned to the route table.
:param routes:
An optional list of dictionaries representing valid Route objects contained within a route table... | salt/states/azurearm_network.py | def route_table_present(name, resource_group, tags=None, routes=None, disable_bgp_route_propagation=None,
connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a route table exists.
:param name:
Name of the route table.
:param resource_group:
... | def route_table_present(name, resource_group, tags=None, routes=None, disable_bgp_route_propagation=None,
connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a route table exists.
:param name:
Name of the route table.
:param resource_group:
... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L2113-L2251 | [
"def",
"route_table_present",
"(",
"name",
",",
"resource_group",
",",
"tags",
"=",
"None",
",",
"routes",
"=",
"None",
",",
"disable_bgp_route_propagation",
"=",
"None",
",",
"connection_auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | route_table_absent | .. versionadded:: 2019.2.0
Ensure a route table does not exist in the resource group.
:param name:
Name of the route table.
:param resource_group:
The resource group assigned to the route table.
:param connection_auth:
A dict with subscription and authentication parameters to... | salt/states/azurearm_network.py | def route_table_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a route table does not exist in the resource group.
:param name:
Name of the route table.
:param resource_group:
The resource group assigned to the route table.
:param co... | def route_table_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a route table does not exist in the resource group.
:param name:
Name of the route table.
:param resource_group:
The resource group assigned to the route table.
:param co... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L2254-L2314 | [
"def",
"route_table_absent",
"(",
"name",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | route_present | .. versionadded:: 2019.2.0
Ensure a route exists within a route table.
:param name:
Name of the route.
:param address_prefix:
The destination CIDR to which the route applies.
:param next_hop_type:
The type of Azure hop the packet should be sent to. Possible values are: 'Virtu... | salt/states/azurearm_network.py | def route_present(name, address_prefix, next_hop_type, route_table, resource_group, next_hop_ip_address=None,
connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a route exists within a route table.
:param name:
Name of the route.
:param address_prefix... | def route_present(name, address_prefix, next_hop_type, route_table, resource_group, next_hop_ip_address=None,
connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a route exists within a route table.
:param name:
Name of the route.
:param address_prefix... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L2317-L2447 | [
"def",
"route_present",
"(",
"name",
",",
"address_prefix",
",",
"next_hop_type",
",",
"route_table",
",",
"resource_group",
",",
"next_hop_ip_address",
"=",
"None",
",",
"connection_auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'n... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | route_absent | .. versionadded:: 2019.2.0
Ensure a route table does not exist in the resource group.
:param name:
Name of the route table.
:param route_table:
The name of the existing route table containing the route.
:param resource_group:
The resource group assigned to the route table.
... | salt/states/azurearm_network.py | def route_absent(name, route_table, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a route table does not exist in the resource group.
:param name:
Name of the route table.
:param route_table:
The name of the existing route table containing the route.... | def route_absent(name, route_table, resource_group, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a route table does not exist in the resource group.
:param name:
Name of the route table.
:param route_table:
The name of the existing route table containing the route.... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_network.py#L2450-L2514 | [
"def",
"route_absent",
"(",
"name",
",",
"route_table",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | gen_jid | Generate a jid | salt/utils/jid.py | def gen_jid(opts=None):
'''
Generate a jid
'''
if opts is None:
salt.utils.versions.warn_until(
'Sodium',
'The `opts` argument was not passed into salt.utils.jid.gen_jid(). '
'This will be required starting in {version}.'
)
opts = {}
global... | def gen_jid(opts=None):
'''
Generate a jid
'''
if opts is None:
salt.utils.versions.warn_until(
'Sodium',
'The `opts` argument was not passed into salt.utils.jid.gen_jid(). '
'This will be required starting in {version}.'
)
opts = {}
global... | [
"Generate",
"a",
"jid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jid.py#L17-L39 | [
"def",
"gen_jid",
"(",
"opts",
"=",
"None",
")",
":",
"if",
"opts",
"is",
"None",
":",
"salt",
".",
"utils",
".",
"versions",
".",
"warn_until",
"(",
"'Sodium'",
",",
"'The `opts` argument was not passed into salt.utils.jid.gen_jid(). '",
"'This will be required start... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | is_jid | Returns True if the passed in value is a job id | salt/utils/jid.py | def is_jid(jid):
'''
Returns True if the passed in value is a job id
'''
if not isinstance(jid, six.string_types):
return False
if len(jid) != 20 and (len(jid) <= 21 or jid[20] != '_'):
return False
try:
int(jid[:20])
return True
except ValueError:
ret... | def is_jid(jid):
'''
Returns True if the passed in value is a job id
'''
if not isinstance(jid, six.string_types):
return False
if len(jid) != 20 and (len(jid) <= 21 or jid[20] != '_'):
return False
try:
int(jid[:20])
return True
except ValueError:
ret... | [
"Returns",
"True",
"if",
"the",
"passed",
"in",
"value",
"is",
"a",
"job",
"id"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jid.py#L42-L54 | [
"def",
"is_jid",
"(",
"jid",
")",
":",
"if",
"not",
"isinstance",
"(",
"jid",
",",
"six",
".",
"string_types",
")",
":",
"return",
"False",
"if",
"len",
"(",
"jid",
")",
"!=",
"20",
"and",
"(",
"len",
"(",
"jid",
")",
"<=",
"21",
"or",
"jid",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | jid_to_time | Convert a salt job id into the time when the job was invoked | salt/utils/jid.py | def jid_to_time(jid):
'''
Convert a salt job id into the time when the job was invoked
'''
jid = six.text_type(jid)
if len(jid) != 20 and (len(jid) <= 21 or jid[20] != '_'):
return ''
year = jid[:4]
month = jid[4:6]
day = jid[6:8]
hour = jid[8:10]
minute = jid[10:12]
... | def jid_to_time(jid):
'''
Convert a salt job id into the time when the job was invoked
'''
jid = six.text_type(jid)
if len(jid) != 20 and (len(jid) <= 21 or jid[20] != '_'):
return ''
year = jid[:4]
month = jid[4:6]
day = jid[6:8]
hour = jid[8:10]
minute = jid[10:12]
... | [
"Convert",
"a",
"salt",
"job",
"id",
"into",
"the",
"time",
"when",
"the",
"job",
"was",
"invoked"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jid.py#L57-L79 | [
"def",
"jid_to_time",
"(",
"jid",
")",
":",
"jid",
"=",
"six",
".",
"text_type",
"(",
"jid",
")",
"if",
"len",
"(",
"jid",
")",
"!=",
"20",
"and",
"(",
"len",
"(",
"jid",
")",
"<=",
"21",
"or",
"jid",
"[",
"20",
"]",
"!=",
"'_'",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | format_job_instance | Format the job instance correctly | salt/utils/jid.py | def format_job_instance(job):
'''
Format the job instance correctly
'''
ret = {'Function': job.get('fun', 'unknown-function'),
'Arguments': list(job.get('arg', [])),
# unlikely but safeguard from invalid returns
'Target': job.get('tgt', 'unknown-target'),
'Tar... | def format_job_instance(job):
'''
Format the job instance correctly
'''
ret = {'Function': job.get('fun', 'unknown-function'),
'Arguments': list(job.get('arg', [])),
# unlikely but safeguard from invalid returns
'Target': job.get('tgt', 'unknown-target'),
'Tar... | [
"Format",
"the",
"job",
"instance",
"correctly"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jid.py#L82-L99 | [
"def",
"format_job_instance",
"(",
"job",
")",
":",
"ret",
"=",
"{",
"'Function'",
":",
"job",
".",
"get",
"(",
"'fun'",
",",
"'unknown-function'",
")",
",",
"'Arguments'",
":",
"list",
"(",
"job",
".",
"get",
"(",
"'arg'",
",",
"[",
"]",
")",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | format_jid_instance | Format the jid correctly | salt/utils/jid.py | def format_jid_instance(jid, job):
'''
Format the jid correctly
'''
ret = format_job_instance(job)
ret.update({'StartTime': jid_to_time(jid)})
return ret | def format_jid_instance(jid, job):
'''
Format the jid correctly
'''
ret = format_job_instance(job)
ret.update({'StartTime': jid_to_time(jid)})
return ret | [
"Format",
"the",
"jid",
"correctly"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jid.py#L102-L108 | [
"def",
"format_jid_instance",
"(",
"jid",
",",
"job",
")",
":",
"ret",
"=",
"format_job_instance",
"(",
"job",
")",
"ret",
".",
"update",
"(",
"{",
"'StartTime'",
":",
"jid_to_time",
"(",
"jid",
")",
"}",
")",
"return",
"ret"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | format_jid_instance_ext | Format the jid correctly with jid included | salt/utils/jid.py | def format_jid_instance_ext(jid, job):
'''
Format the jid correctly with jid included
'''
ret = format_job_instance(job)
ret.update({
'JID': jid,
'StartTime': jid_to_time(jid)})
return ret | def format_jid_instance_ext(jid, job):
'''
Format the jid correctly with jid included
'''
ret = format_job_instance(job)
ret.update({
'JID': jid,
'StartTime': jid_to_time(jid)})
return ret | [
"Format",
"the",
"jid",
"correctly",
"with",
"jid",
"included"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jid.py#L111-L119 | [
"def",
"format_jid_instance_ext",
"(",
"jid",
",",
"job",
")",
":",
"ret",
"=",
"format_job_instance",
"(",
"job",
")",
"ret",
".",
"update",
"(",
"{",
"'JID'",
":",
"jid",
",",
"'StartTime'",
":",
"jid_to_time",
"(",
"jid",
")",
"}",
")",
"return",
"r... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | jid_dir | Return the jid_dir for the given job id | salt/utils/jid.py | def jid_dir(jid, job_dir=None, hash_type='sha256'):
'''
Return the jid_dir for the given job id
'''
if not isinstance(jid, six.string_types):
jid = six.text_type(jid)
jhash = getattr(hashlib, hash_type)(
salt.utils.stringutils.to_bytes(jid)).hexdigest()
parts = []
if job_dir... | def jid_dir(jid, job_dir=None, hash_type='sha256'):
'''
Return the jid_dir for the given job id
'''
if not isinstance(jid, six.string_types):
jid = six.text_type(jid)
jhash = getattr(hashlib, hash_type)(
salt.utils.stringutils.to_bytes(jid)).hexdigest()
parts = []
if job_dir... | [
"Return",
"the",
"jid_dir",
"for",
"the",
"given",
"job",
"id"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/jid.py#L122-L135 | [
"def",
"jid_dir",
"(",
"jid",
",",
"job_dir",
"=",
"None",
",",
"hash_type",
"=",
"'sha256'",
")",
":",
"if",
"not",
"isinstance",
"(",
"jid",
",",
"six",
".",
"string_types",
")",
":",
"jid",
"=",
"six",
".",
"text_type",
"(",
"jid",
")",
"jhash",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | init | Change the system runlevel on sysV compatible systems
CLI Example:
.. code-block:: bash
salt '*' system.init 3 | salt/modules/system.py | def init(runlevel):
'''
Change the system runlevel on sysV compatible systems
CLI Example:
.. code-block:: bash
salt '*' system.init 3
'''
cmd = ['init', '{0}'.format(runlevel)]
ret = __salt__['cmd.run'](cmd, python_shell=False)
return ret | def init(runlevel):
'''
Change the system runlevel on sysV compatible systems
CLI Example:
.. code-block:: bash
salt '*' system.init 3
'''
cmd = ['init', '{0}'.format(runlevel)]
ret = __salt__['cmd.run'](cmd, python_shell=False)
return ret | [
"Change",
"the",
"system",
"runlevel",
"on",
"sysV",
"compatible",
"systems"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/system.py#L64-L76 | [
"def",
"init",
"(",
"runlevel",
")",
":",
"cmd",
"=",
"[",
"'init'",
",",
"'{0}'",
".",
"format",
"(",
"runlevel",
")",
"]",
"ret",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"return",
"ret"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reboot | Reboot the system
at_time
The wait time in minutes before the system will be rebooted.
CLI Example:
.. code-block:: bash
salt '*' system.reboot | salt/modules/system.py | def reboot(at_time=None):
'''
Reboot the system
at_time
The wait time in minutes before the system will be rebooted.
CLI Example:
.. code-block:: bash
salt '*' system.reboot
'''
cmd = ['shutdown', '-r', ('{0}'.format(at_time) if at_time else 'now')]
ret = __salt__['cm... | def reboot(at_time=None):
'''
Reboot the system
at_time
The wait time in minutes before the system will be rebooted.
CLI Example:
.. code-block:: bash
salt '*' system.reboot
'''
cmd = ['shutdown', '-r', ('{0}'.format(at_time) if at_time else 'now')]
ret = __salt__['cm... | [
"Reboot",
"the",
"system"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/system.py#L94-L109 | [
"def",
"reboot",
"(",
"at_time",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'shutdown'",
",",
"'-r'",
",",
"(",
"'{0}'",
".",
"format",
"(",
"at_time",
")",
"if",
"at_time",
"else",
"'now'",
")",
"]",
"ret",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | shutdown | Shutdown a running system
at_time
The wait time in minutes before the system will be shutdown.
CLI Example:
.. code-block:: bash
salt '*' system.shutdown 5 | salt/modules/system.py | def shutdown(at_time=None):
'''
Shutdown a running system
at_time
The wait time in minutes before the system will be shutdown.
CLI Example:
.. code-block:: bash
salt '*' system.shutdown 5
'''
cmd = ['shutdown', '-h', ('{0}'.format(at_time) if at_time else 'now')]
ret ... | def shutdown(at_time=None):
'''
Shutdown a running system
at_time
The wait time in minutes before the system will be shutdown.
CLI Example:
.. code-block:: bash
salt '*' system.shutdown 5
'''
cmd = ['shutdown', '-h', ('{0}'.format(at_time) if at_time else 'now')]
ret ... | [
"Shutdown",
"a",
"running",
"system"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/system.py#L112-L127 | [
"def",
"shutdown",
"(",
"at_time",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'shutdown'",
",",
"'-h'",
",",
"(",
"'{0}'",
".",
"format",
"(",
"at_time",
")",
"if",
"at_time",
"else",
"'now'",
")",
"]",
"ret",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _date_bin_set_datetime | set the system date/time using the date command
Note using a strictly posix-compliant date binary we can only set the date
up to the minute. | salt/modules/system.py | def _date_bin_set_datetime(new_date):
'''
set the system date/time using the date command
Note using a strictly posix-compliant date binary we can only set the date
up to the minute.
'''
cmd = ['date']
# if there is a timezone in the datetime object use that offset
# This will modify t... | def _date_bin_set_datetime(new_date):
'''
set the system date/time using the date command
Note using a strictly posix-compliant date binary we can only set the date
up to the minute.
'''
cmd = ['date']
# if there is a timezone in the datetime object use that offset
# This will modify t... | [
"set",
"the",
"system",
"date",
"/",
"time",
"using",
"the",
"date",
"command"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/system.py#L130-L169 | [
"def",
"_date_bin_set_datetime",
"(",
"new_date",
")",
":",
"cmd",
"=",
"[",
"'date'",
"]",
"# if there is a timezone in the datetime object use that offset",
"# This will modify the new_date to be the equivalent time in UTC",
"if",
"new_date",
".",
"utcoffset",
"(",
")",
"is",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | has_settable_hwclock | Returns True if the system has a hardware clock capable of being
set from software.
CLI Example:
salt '*' system.has_settable_hwclock | salt/modules/system.py | def has_settable_hwclock():
'''
Returns True if the system has a hardware clock capable of being
set from software.
CLI Example:
salt '*' system.has_settable_hwclock
'''
if salt.utils.path.which_bin(['hwclock']) is not None:
res = __salt__['cmd.run_all'](
['hwclock', '-... | def has_settable_hwclock():
'''
Returns True if the system has a hardware clock capable of being
set from software.
CLI Example:
salt '*' system.has_settable_hwclock
'''
if salt.utils.path.which_bin(['hwclock']) is not None:
res = __salt__['cmd.run_all'](
['hwclock', '-... | [
"Returns",
"True",
"if",
"the",
"system",
"has",
"a",
"hardware",
"clock",
"capable",
"of",
"being",
"set",
"from",
"software",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/system.py#L172-L187 | [
"def",
"has_settable_hwclock",
"(",
")",
":",
"if",
"salt",
".",
"utils",
".",
"path",
".",
"which_bin",
"(",
"[",
"'hwclock'",
"]",
")",
"is",
"not",
"None",
":",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"[",
"'hwclock'",
",",
"'--test'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _swclock_to_hwclock | Set hardware clock to value of software clock. | salt/modules/system.py | def _swclock_to_hwclock():
'''
Set hardware clock to value of software clock.
'''
res = __salt__['cmd.run_all'](['hwclock', '--systohc'], python_shell=False)
if res['retcode'] != 0:
msg = 'hwclock failed to set hardware clock from software clock: {0}'.format(res['stderr'])
raise Comm... | def _swclock_to_hwclock():
'''
Set hardware clock to value of software clock.
'''
res = __salt__['cmd.run_all'](['hwclock', '--systohc'], python_shell=False)
if res['retcode'] != 0:
msg = 'hwclock failed to set hardware clock from software clock: {0}'.format(res['stderr'])
raise Comm... | [
"Set",
"hardware",
"clock",
"to",
"value",
"of",
"software",
"clock",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/system.py#L190-L198 | [
"def",
"_swclock_to_hwclock",
"(",
")",
":",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"[",
"'hwclock'",
",",
"'--systohc'",
"]",
",",
"python_shell",
"=",
"False",
")",
"if",
"res",
"[",
"'retcode'",
"]",
"!=",
"0",
":",
"msg",
"=",
"'hw... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.