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 | _verify_subnet_association | Helper function verify a subnet's route table association
route_table_desc
the description of a route table, as returned from boto_vpc.describe_route_table
subnet_id
the subnet id to verify
.. versionadded:: 2016.11.0 | salt/states/boto_vpc.py | def _verify_subnet_association(route_table_desc, subnet_id):
'''
Helper function verify a subnet's route table association
route_table_desc
the description of a route table, as returned from boto_vpc.describe_route_table
subnet_id
the subnet id to verify
.. versionadded:: 2016.11.... | def _verify_subnet_association(route_table_desc, subnet_id):
'''
Helper function verify a subnet's route table association
route_table_desc
the description of a route table, as returned from boto_vpc.describe_route_table
subnet_id
the subnet id to verify
.. versionadded:: 2016.11.... | [
"Helper",
"function",
"verify",
"a",
"subnet",
"s",
"route",
"table",
"association"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L674-L691 | [
"def",
"_verify_subnet_association",
"(",
"route_table_desc",
",",
"subnet_id",
")",
":",
"if",
"route_table_desc",
":",
"if",
"'associations'",
"in",
"route_table_desc",
":",
"for",
"association",
"in",
"route_table_desc",
"[",
"'associations'",
"]",
":",
"if",
"as... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | subnet_absent | Ensure subnet with passed properties is absent.
name
Name of the subnet.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
profile
A dict with region, key and keyid, or a pillar key (string) that
contains a dict ... | salt/states/boto_vpc.py | def subnet_absent(name=None, subnet_id=None, region=None, key=None, keyid=None, profile=None):
'''
Ensure subnet with passed properties is absent.
name
Name of the subnet.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
... | def subnet_absent(name=None, subnet_id=None, region=None, key=None, keyid=None, profile=None):
'''
Ensure subnet with passed properties is absent.
name
Name of the subnet.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
... | [
"Ensure",
"subnet",
"with",
"passed",
"properties",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L694-L751 | [
"def",
"subnet_absent",
"(",
"name",
"=",
"None",
",",
"subnet_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | internet_gateway_present | Ensure an internet gateway exists.
name
Name of the internet gateway.
vpc_name
Name of the VPC to which the internet gateway should be attached.
vpc_id
Id of the VPC to which the internet_gateway should be attached.
Only one of vpc_name or vpc_id may be provided.
tags... | salt/states/boto_vpc.py | def internet_gateway_present(name, vpc_name=None, vpc_id=None,
tags=None, region=None, key=None,
keyid=None, profile=None):
'''
Ensure an internet gateway exists.
name
Name of the internet gateway.
vpc_name
Name of the VPC to wh... | def internet_gateway_present(name, vpc_name=None, vpc_id=None,
tags=None, region=None, key=None,
keyid=None, profile=None):
'''
Ensure an internet gateway exists.
name
Name of the internet gateway.
vpc_name
Name of the VPC to wh... | [
"Ensure",
"an",
"internet",
"gateway",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L754-L821 | [
"def",
"internet_gateway_present",
"(",
"name",
",",
"vpc_name",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | internet_gateway_absent | Ensure the named internet gateway is absent.
name
Name of the internet gateway.
detach
First detach the internet gateway from a VPC, if attached.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
profile
A d... | salt/states/boto_vpc.py | def internet_gateway_absent(name, detach=False, region=None,
key=None, keyid=None, profile=None):
'''
Ensure the named internet gateway is absent.
name
Name of the internet gateway.
detach
First detach the internet gateway from a VPC, if attached.
regio... | def internet_gateway_absent(name, detach=False, region=None,
key=None, keyid=None, profile=None):
'''
Ensure the named internet gateway is absent.
name
Name of the internet gateway.
detach
First detach the internet gateway from a VPC, if attached.
regio... | [
"Ensure",
"the",
"named",
"internet",
"gateway",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L824-L883 | [
"def",
"internet_gateway_absent",
"(",
"name",
",",
"detach",
"=",
"False",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | route_table_present | Ensure route table with routes exists and is associated to a VPC.
This function requires boto3 to be installed if nat gatewyas are specified.
Example:
.. code-block:: yaml
boto_vpc.route_table_present:
- name: my_route_table
- vpc_id: vpc-123456
- routes:
... | salt/states/boto_vpc.py | def route_table_present(name, vpc_name=None, vpc_id=None, routes=None,
subnet_ids=None, subnet_names=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Ensure route table with routes exists and is associated to a VPC.
This function require... | def route_table_present(name, vpc_name=None, vpc_id=None, routes=None,
subnet_ids=None, subnet_names=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Ensure route table with routes exists and is associated to a VPC.
This function require... | [
"Ensure",
"route",
"table",
"with",
"routes",
"exists",
"and",
"is",
"associated",
"to",
"a",
"VPC",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L886-L983 | [
"def",
"route_table_present",
"(",
"name",
",",
"vpc_name",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"routes",
"=",
"None",
",",
"subnet_ids",
"=",
"None",
",",
"subnet_names",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | route_table_absent | Ensure the named route table is absent.
name
Name of the route table.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
profile
A dict with region, key and keyid, or a pillar key (string) that
contains a dict wit... | salt/states/boto_vpc.py | def route_table_absent(name, region=None,
key=None, keyid=None, profile=None):
'''
Ensure the named route table is absent.
name
Name of the route table.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.... | def route_table_absent(name, region=None,
key=None, keyid=None, profile=None):
'''
Ensure the named route table is absent.
name
Name of the route table.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.... | [
"Ensure",
"the",
"named",
"route",
"table",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1235-L1293 | [
"def",
"route_table_absent",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'comment'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | nat_gateway_present | Ensure a nat gateway exists within the specified subnet
This function requires boto3.
.. versionadded:: 2016.11.0
Example:
.. code-block:: yaml
boto_vpc.nat_gateway_present:
- subnet_name: my-subnet
name
Name of the state
subnet_name
Name of the subnet wi... | salt/states/boto_vpc.py | def nat_gateway_present(name, subnet_name=None, subnet_id=None,
region=None, key=None, keyid=None, profile=None, allocation_id=None):
'''
Ensure a nat gateway exists within the specified subnet
This function requires boto3.
.. versionadded:: 2016.11.0
Example:
.. code... | def nat_gateway_present(name, subnet_name=None, subnet_id=None,
region=None, key=None, keyid=None, profile=None, allocation_id=None):
'''
Ensure a nat gateway exists within the specified subnet
This function requires boto3.
.. versionadded:: 2016.11.0
Example:
.. code... | [
"Ensure",
"a",
"nat",
"gateway",
"exists",
"within",
"the",
"specified",
"subnet"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1296-L1374 | [
"def",
"nat_gateway_present",
"(",
"name",
",",
"subnet_name",
"=",
"None",
",",
"subnet_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"allocation_id",
"=",
"None",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | nat_gateway_absent | Ensure the nat gateway in the named subnet is absent.
This function requires boto3.
.. versionadded:: 2016.11.0
name
Name of the state.
subnet_name
Name of the subnet within which the nat gateway should exist
subnet_id
Id of the subnet within which the nat gateway should... | salt/states/boto_vpc.py | def nat_gateway_absent(name=None, subnet_name=None, subnet_id=None,
region=None, key=None, keyid=None, profile=None,
wait_for_delete_retries=0):
'''
Ensure the nat gateway in the named subnet is absent.
This function requires boto3.
.. versionadded:: 2016.... | def nat_gateway_absent(name=None, subnet_name=None, subnet_id=None,
region=None, key=None, keyid=None, profile=None,
wait_for_delete_retries=0):
'''
Ensure the nat gateway in the named subnet is absent.
This function requires boto3.
.. versionadded:: 2016.... | [
"Ensure",
"the",
"nat",
"gateway",
"in",
"the",
"named",
"subnet",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1377-L1454 | [
"def",
"nat_gateway_absent",
"(",
"name",
"=",
"None",
",",
"subnet_name",
"=",
"None",
",",
"subnet_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"wait_for_delete_retr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | accept_vpc_peering_connection | Accept a VPC pending requested peering connection between two VPCs.
name
Name of this state
conn_id
The connection ID to accept. Exclusive with conn_name. String type.
conn_name
The name of the VPC peering connection to accept. Exclusive with conn_id. String type.
region
... | salt/states/boto_vpc.py | def accept_vpc_peering_connection(name=None, conn_id=None, conn_name=None,
region=None, key=None, keyid=None, profile=None):
'''
Accept a VPC pending requested peering connection between two VPCs.
name
Name of this state
conn_id
The connection ID to ac... | def accept_vpc_peering_connection(name=None, conn_id=None, conn_name=None,
region=None, key=None, keyid=None, profile=None):
'''
Accept a VPC pending requested peering connection between two VPCs.
name
Name of this state
conn_id
The connection ID to ac... | [
"Accept",
"a",
"VPC",
"pending",
"requested",
"peering",
"connection",
"between",
"two",
"VPCs",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1458-L1534 | [
"def",
"accept_vpc_peering_connection",
"(",
"name",
"=",
"None",
",",
"conn_id",
"=",
"None",
",",
"conn_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"log",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | request_vpc_peering_connection | name
Name of the state
requester_vpc_id
ID of the requesting VPC. Exclusive with requester_vpc_name. String type.
requester_vpc_name
Name tag of the requesting VPC. Exclusive with requester_vpc_id. String type.
peer_vpc_id
ID of the VPC tp crete VPC peering connection wi... | salt/states/boto_vpc.py | def request_vpc_peering_connection(name, requester_vpc_id=None, requester_vpc_name=None,
peer_vpc_id=None, peer_vpc_name=None, conn_name=None,
peer_owner_id=None, peer_region=None, region=None,
key=None, keyid=None,... | def request_vpc_peering_connection(name, requester_vpc_id=None, requester_vpc_name=None,
peer_vpc_id=None, peer_vpc_name=None, conn_name=None,
peer_owner_id=None, peer_region=None, region=None,
key=None, keyid=None,... | [
"name",
"Name",
"of",
"the",
"state"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1538-L1646 | [
"def",
"request_vpc_peering_connection",
"(",
"name",
",",
"requester_vpc_id",
"=",
"None",
",",
"requester_vpc_name",
"=",
"None",
",",
"peer_vpc_id",
"=",
"None",
",",
"peer_vpc_name",
"=",
"None",
",",
"conn_name",
"=",
"None",
",",
"peer_owner_id",
"=",
"Non... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | vpc_peering_connection_present | name
Name of the state
requester_vpc_id
ID of the requesting VPC. Exclusive with requester_vpc_name.
requester_vpc_name
Name tag of the requesting VPC. Exclusive with requester_vpc_id.
peer_vpc_id
ID of the VPC tp crete VPC peering connection with. This can be a VPC in
... | salt/states/boto_vpc.py | def vpc_peering_connection_present(name, requester_vpc_id=None, requester_vpc_name=None,
peer_vpc_id=None, peer_vpc_name=None, conn_name=None,
peer_owner_id=None, peer_region=None, region=None,
key=None, keyid=None,... | def vpc_peering_connection_present(name, requester_vpc_id=None, requester_vpc_name=None,
peer_vpc_id=None, peer_vpc_name=None, conn_name=None,
peer_owner_id=None, peer_region=None, region=None,
key=None, keyid=None,... | [
"name",
"Name",
"of",
"the",
"state"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1649-L1736 | [
"def",
"vpc_peering_connection_present",
"(",
"name",
",",
"requester_vpc_id",
"=",
"None",
",",
"requester_vpc_name",
"=",
"None",
",",
"peer_vpc_id",
"=",
"None",
",",
"peer_vpc_name",
"=",
"None",
",",
"conn_name",
"=",
"None",
",",
"peer_owner_id",
"=",
"Non... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_vpc_peering_connection | name
Name of the state
conn_id
ID of the peering connection to delete. Exclusive with conn_name.
conn_name
The name of the peering connection to delete. Exclusive with conn_id.
region
Region to connect to.
key
Secret key to be used.
keyid
Access... | salt/states/boto_vpc.py | def delete_vpc_peering_connection(name, conn_id=None, conn_name=None,
region=None, key=None, keyid=None, profile=None):
'''
name
Name of the state
conn_id
ID of the peering connection to delete. Exclusive with conn_name.
conn_name
The name of ... | def delete_vpc_peering_connection(name, conn_id=None, conn_name=None,
region=None, key=None, keyid=None, profile=None):
'''
name
Name of the state
conn_id
ID of the peering connection to delete. Exclusive with conn_name.
conn_name
The name of ... | [
"name",
"Name",
"of",
"the",
"state"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L1745-L1829 | [
"def",
"delete_vpc_peering_connection",
"(",
"name",
",",
"conn_id",
"=",
"None",
",",
"conn_name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | zap | Destroy the partition table and content of a given disk.
.. code-block:: bash
salt '*' ceph.osd_prepare 'dev'='/dev/vdc' \\
'cluster_name'='ceph' \\
'cluster_uuid'='cluster_uuid'
dev
The block device to format.
cluster_name
The cluster name. Defaul... | salt/modules/ceph.py | def zap(target=None, **kwargs):
'''
Destroy the partition table and content of a given disk.
.. code-block:: bash
salt '*' ceph.osd_prepare 'dev'='/dev/vdc' \\
'cluster_name'='ceph' \\
'cluster_uuid'='cluster_uuid'
dev
The block device to format.
c... | def zap(target=None, **kwargs):
'''
Destroy the partition table and content of a given disk.
.. code-block:: bash
salt '*' ceph.osd_prepare 'dev'='/dev/vdc' \\
'cluster_name'='ceph' \\
'cluster_uuid'='cluster_uuid'
dev
The block device to format.
c... | [
"Destroy",
"the",
"partition",
"table",
"and",
"content",
"of",
"a",
"given",
"disk",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ceph.py#L98-L121 | [
"def",
"zap",
"(",
"target",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"target",
"is",
"not",
"None",
":",
"log",
".",
"warning",
"(",
"\"Depricated use of function, use kwargs\"",
")",
"target",
"=",
"kwargs",
".",
"get",
"(",
"\"dev\"",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_vs | Create a virtual server
CLI Examples:
.. code-block:: bash
salt-run f5.create_vs lbalancer vs_name 10.0.0.1 80 tcp http poolname | salt/runners/f5.py | def create_vs(lb, name, ip, port, protocol, profile, pool_name):
'''
Create a virtual server
CLI Examples:
.. code-block:: bash
salt-run f5.create_vs lbalancer vs_name 10.0.0.1 80 tcp http poolname
'''
if __opts__['load_balancers'].get(lb, None):
(username, password) = list(__... | def create_vs(lb, name, ip, port, protocol, profile, pool_name):
'''
Create a virtual server
CLI Examples:
.. code-block:: bash
salt-run f5.create_vs lbalancer vs_name 10.0.0.1 80 tcp http poolname
'''
if __opts__['load_balancers'].get(lb, None):
(username, password) = list(__... | [
"Create",
"a",
"virtual",
"server"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L235-L252 | [
"def",
"create_vs",
"(",
"lb",
",",
"name",
",",
"ip",
",",
"port",
",",
"protocol",
",",
"profile",
",",
"pool_name",
")",
":",
"if",
"__opts__",
"[",
"'load_balancers'",
"]",
".",
"get",
"(",
"lb",
",",
"None",
")",
":",
"(",
"username",
",",
"pa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_pool | Create a pool on the F5 load balancer
CLI Examples:
.. code-block:: bash
salt-run f5.create_pool load_balancer pool_name loadbalance_method
salt-run f5.create_pool load_balancer my_pool ROUND_ROBIN | salt/runners/f5.py | def create_pool(lb, name, method='ROUND_ROBIN'):
'''
Create a pool on the F5 load balancer
CLI Examples:
.. code-block:: bash
salt-run f5.create_pool load_balancer pool_name loadbalance_method
salt-run f5.create_pool load_balancer my_pool ROUND_ROBIN
'''
if __opts__['load_bala... | def create_pool(lb, name, method='ROUND_ROBIN'):
'''
Create a pool on the F5 load balancer
CLI Examples:
.. code-block:: bash
salt-run f5.create_pool load_balancer pool_name loadbalance_method
salt-run f5.create_pool load_balancer my_pool ROUND_ROBIN
'''
if __opts__['load_bala... | [
"Create",
"a",
"pool",
"on",
"the",
"F5",
"load",
"balancer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L255-L272 | [
"def",
"create_pool",
"(",
"lb",
",",
"name",
",",
"method",
"=",
"'ROUND_ROBIN'",
")",
":",
"if",
"__opts__",
"[",
"'load_balancers'",
"]",
".",
"get",
"(",
"lb",
",",
"None",
")",
":",
"(",
"username",
",",
"password",
")",
"=",
"list",
"(",
"__opt... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_pool_member | Add a node to a pool
CLI Examples:
.. code-block:: bash
salt-run f5.add_pool_member load_balancer 10.0.0.1 80 my_pool | salt/runners/f5.py | def add_pool_member(lb, name, port, pool_name):
'''
Add a node to a pool
CLI Examples:
.. code-block:: bash
salt-run f5.add_pool_member load_balancer 10.0.0.1 80 my_pool
'''
if __opts__['load_balancers'].get(lb, None):
(username, password) = list(__opts__['load_balancers'][lb]... | def add_pool_member(lb, name, port, pool_name):
'''
Add a node to a pool
CLI Examples:
.. code-block:: bash
salt-run f5.add_pool_member load_balancer 10.0.0.1 80 my_pool
'''
if __opts__['load_balancers'].get(lb, None):
(username, password) = list(__opts__['load_balancers'][lb]... | [
"Add",
"a",
"node",
"to",
"a",
"pool"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L275-L291 | [
"def",
"add_pool_member",
"(",
"lb",
",",
"name",
",",
"port",
",",
"pool_name",
")",
":",
"if",
"__opts__",
"[",
"'load_balancers'",
"]",
".",
"get",
"(",
"lb",
",",
"None",
")",
":",
"(",
"username",
",",
"password",
")",
"=",
"list",
"(",
"__opts_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_pool | Check to see if a pool exists
CLI Examples:
.. code-block:: bash
salt-run f5.check_pool load_balancer pool_name | salt/runners/f5.py | def check_pool(lb, name):
'''
Check to see if a pool exists
CLI Examples:
.. code-block:: bash
salt-run f5.check_pool load_balancer pool_name
'''
if __opts__['load_balancers'].get(lb, None):
(username, password) = list(__opts__['load_balancers'][lb].values())
else:
... | def check_pool(lb, name):
'''
Check to see if a pool exists
CLI Examples:
.. code-block:: bash
salt-run f5.check_pool load_balancer pool_name
'''
if __opts__['load_balancers'].get(lb, None):
(username, password) = list(__opts__['load_balancers'][lb].values())
else:
... | [
"Check",
"to",
"see",
"if",
"a",
"pool",
"exists"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L294-L309 | [
"def",
"check_pool",
"(",
"lb",
",",
"name",
")",
":",
"if",
"__opts__",
"[",
"'load_balancers'",
"]",
".",
"get",
"(",
"lb",
",",
"None",
")",
":",
"(",
"username",
",",
"password",
")",
"=",
"list",
"(",
"__opts__",
"[",
"'load_balancers'",
"]",
"[... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_member_pool | Check a pool member exists in a specific pool
CLI Examples:
.. code-block:: bash
salt-run f5.check_member_pool load_balancer 10.0.0.1 my_pool | salt/runners/f5.py | def check_member_pool(lb, member, pool_name):
'''
Check a pool member exists in a specific pool
CLI Examples:
.. code-block:: bash
salt-run f5.check_member_pool load_balancer 10.0.0.1 my_pool
'''
if __opts__['load_balancers'].get(lb, None):
(username, password) = list(__opts__... | def check_member_pool(lb, member, pool_name):
'''
Check a pool member exists in a specific pool
CLI Examples:
.. code-block:: bash
salt-run f5.check_member_pool load_balancer 10.0.0.1 my_pool
'''
if __opts__['load_balancers'].get(lb, None):
(username, password) = list(__opts__... | [
"Check",
"a",
"pool",
"member",
"exists",
"in",
"a",
"specific",
"pool"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L330-L345 | [
"def",
"check_member_pool",
"(",
"lb",
",",
"member",
",",
"pool_name",
")",
":",
"if",
"__opts__",
"[",
"'load_balancers'",
"]",
".",
"get",
"(",
"lb",
",",
"None",
")",
":",
"(",
"username",
",",
"password",
")",
"=",
"list",
"(",
"__opts__",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | F5Mgmt._connect | Connect to F5 | salt/runners/f5.py | def _connect(self):
'''
Connect to F5
'''
try:
self.bigIP = f5.BIGIP(hostname=self.lb,
username=self.username,
password=self.password,
fromurl=True,
... | def _connect(self):
'''
Connect to F5
'''
try:
self.bigIP = f5.BIGIP(hostname=self.lb,
username=self.username,
password=self.password,
fromurl=True,
... | [
"Connect",
"to",
"F5"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L45-L61 | [
"def",
"_connect",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"bigIP",
"=",
"f5",
".",
"BIGIP",
"(",
"hostname",
"=",
"self",
".",
"lb",
",",
"username",
"=",
"self",
".",
"username",
",",
"password",
"=",
"self",
".",
"password",
",",
"fromur... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | F5Mgmt.create_vs | Create a virtual server | salt/runners/f5.py | def create_vs(self, name, ip, port, protocol, profile, pool_name):
'''
Create a virtual server
'''
vs = self.bigIP.LocalLB.VirtualServer
vs_def = vs.typefactory.create('Common.VirtualServerDefinition')
vs_def.name = name
vs_def.address = ip
vs_def.port = ... | def create_vs(self, name, ip, port, protocol, profile, pool_name):
'''
Create a virtual server
'''
vs = self.bigIP.LocalLB.VirtualServer
vs_def = vs.typefactory.create('Common.VirtualServerDefinition')
vs_def.name = name
vs_def.address = ip
vs_def.port = ... | [
"Create",
"a",
"virtual",
"server"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L63-L134 | [
"def",
"create_vs",
"(",
"self",
",",
"name",
",",
"ip",
",",
"port",
",",
"protocol",
",",
"profile",
",",
"pool_name",
")",
":",
"vs",
"=",
"self",
".",
"bigIP",
".",
"LocalLB",
".",
"VirtualServer",
"vs_def",
"=",
"vs",
".",
"typefactory",
".",
"c... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | F5Mgmt.create_pool | Create a pool on the F5 load balancer | salt/runners/f5.py | def create_pool(self, name, method='ROUND_ROBIN'):
'''
Create a pool on the F5 load balancer
'''
lbmethods = self.bigIP.LocalLB.Pool.typefactory.create(
'LocalLB.LBMethod'
)
supported_method = [i[0] for i in lbmethods if (
i[0].split('_', 2)[-1] =... | def create_pool(self, name, method='ROUND_ROBIN'):
'''
Create a pool on the F5 load balancer
'''
lbmethods = self.bigIP.LocalLB.Pool.typefactory.create(
'LocalLB.LBMethod'
)
supported_method = [i[0] for i in lbmethods if (
i[0].split('_', 2)[-1] =... | [
"Create",
"a",
"pool",
"on",
"the",
"F5",
"load",
"balancer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L136-L159 | [
"def",
"create_pool",
"(",
"self",
",",
"name",
",",
"method",
"=",
"'ROUND_ROBIN'",
")",
":",
"lbmethods",
"=",
"self",
".",
"bigIP",
".",
"LocalLB",
".",
"Pool",
".",
"typefactory",
".",
"create",
"(",
"'LocalLB.LBMethod'",
")",
"supported_method",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | F5Mgmt.add_pool_member | Add a node to a pool | salt/runners/f5.py | def add_pool_member(self, name, port, pool_name):
'''
Add a node to a pool
'''
if not self.check_pool(pool_name):
raise CommandExecutionError(
'{0} pool does not exists'.format(pool_name)
)
members_seq = self.bigIP.LocalLB.Pool.typefactory... | def add_pool_member(self, name, port, pool_name):
'''
Add a node to a pool
'''
if not self.check_pool(pool_name):
raise CommandExecutionError(
'{0} pool does not exists'.format(pool_name)
)
members_seq = self.bigIP.LocalLB.Pool.typefactory... | [
"Add",
"a",
"node",
"to",
"a",
"pool"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L161-L193 | [
"def",
"add_pool_member",
"(",
"self",
",",
"name",
",",
"port",
",",
"pool_name",
")",
":",
"if",
"not",
"self",
".",
"check_pool",
"(",
"pool_name",
")",
":",
"raise",
"CommandExecutionError",
"(",
"'{0} pool does not exists'",
".",
"format",
"(",
"pool_name... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | F5Mgmt.check_pool | Check to see if a pool exists | salt/runners/f5.py | def check_pool(self, name):
'''
Check to see if a pool exists
'''
pools = self.bigIP.LocalLB.Pool
for pool in pools.get_list():
if pool.split('/')[-1] == name:
return True
return False | def check_pool(self, name):
'''
Check to see if a pool exists
'''
pools = self.bigIP.LocalLB.Pool
for pool in pools.get_list():
if pool.split('/')[-1] == name:
return True
return False | [
"Check",
"to",
"see",
"if",
"a",
"pool",
"exists"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L195-L203 | [
"def",
"check_pool",
"(",
"self",
",",
"name",
")",
":",
"pools",
"=",
"self",
".",
"bigIP",
".",
"LocalLB",
".",
"Pool",
"for",
"pool",
"in",
"pools",
".",
"get_list",
"(",
")",
":",
"if",
"pool",
".",
"split",
"(",
"'/'",
")",
"[",
"-",
"1",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | F5Mgmt.check_virtualserver | Check to see if a virtual server exists | salt/runners/f5.py | def check_virtualserver(self, name):
'''
Check to see if a virtual server exists
'''
vs = self.bigIP.LocalLB.VirtualServer
for v in vs.get_list():
if v.split('/')[-1] == name:
return True
return False | def check_virtualserver(self, name):
'''
Check to see if a virtual server exists
'''
vs = self.bigIP.LocalLB.VirtualServer
for v in vs.get_list():
if v.split('/')[-1] == name:
return True
return False | [
"Check",
"to",
"see",
"if",
"a",
"virtual",
"server",
"exists"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L205-L213 | [
"def",
"check_virtualserver",
"(",
"self",
",",
"name",
")",
":",
"vs",
"=",
"self",
".",
"bigIP",
".",
"LocalLB",
".",
"VirtualServer",
"for",
"v",
"in",
"vs",
".",
"get_list",
"(",
")",
":",
"if",
"v",
".",
"split",
"(",
"'/'",
")",
"[",
"-",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | F5Mgmt.check_member_pool | Check a pool member exists in a specific pool | salt/runners/f5.py | def check_member_pool(self, member, pool_name):
'''
Check a pool member exists in a specific pool
'''
members = self.bigIP.LocalLB.Pool.get_member(pool_names=[pool_name])[0]
for mem in members:
if member == mem.address:
return True
return False | def check_member_pool(self, member, pool_name):
'''
Check a pool member exists in a specific pool
'''
members = self.bigIP.LocalLB.Pool.get_member(pool_names=[pool_name])[0]
for mem in members:
if member == mem.address:
return True
return False | [
"Check",
"a",
"pool",
"member",
"exists",
"in",
"a",
"specific",
"pool"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L215-L223 | [
"def",
"check_member_pool",
"(",
"self",
",",
"member",
",",
"pool_name",
")",
":",
"members",
"=",
"self",
".",
"bigIP",
".",
"LocalLB",
".",
"Pool",
".",
"get_member",
"(",
"pool_names",
"=",
"[",
"pool_name",
"]",
")",
"[",
"0",
"]",
"for",
"mem",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | F5Mgmt.lbmethods | List all the load balancer methods | salt/runners/f5.py | def lbmethods(self):
'''
List all the load balancer methods
'''
methods = self.bigIP.LocalLB.Pool.typefactory.create(
'LocalLB.LBMethod'
)
return [method[0].split('_', 2)[-1] for method in methods] | def lbmethods(self):
'''
List all the load balancer methods
'''
methods = self.bigIP.LocalLB.Pool.typefactory.create(
'LocalLB.LBMethod'
)
return [method[0].split('_', 2)[-1] for method in methods] | [
"List",
"all",
"the",
"load",
"balancer",
"methods"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/f5.py#L225-L232 | [
"def",
"lbmethods",
"(",
"self",
")",
":",
"methods",
"=",
"self",
".",
"bigIP",
".",
"LocalLB",
".",
"Pool",
".",
"typefactory",
".",
"create",
"(",
"'LocalLB.LBMethod'",
")",
"return",
"[",
"method",
"[",
"0",
"]",
".",
"split",
"(",
"'_'",
",",
"2... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_conn | Return a conn object for the passed VM data | salt/cloud/clouds/softlayer.py | def get_conn(service='SoftLayer_Virtual_Guest'):
'''
Return a conn object for the passed VM data
'''
client = SoftLayer.Client(
username=config.get_cloud_config_value(
'user', get_configured_provider(), __opts__, search_global=False
),
api_key=config.get_cloud_config_... | def get_conn(service='SoftLayer_Virtual_Guest'):
'''
Return a conn object for the passed VM data
'''
client = SoftLayer.Client(
username=config.get_cloud_config_value(
'user', get_configured_provider(), __opts__, search_global=False
),
api_key=config.get_cloud_config_... | [
"Return",
"a",
"conn",
"object",
"for",
"the",
"passed",
"VM",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L104-L116 | [
"def",
"get_conn",
"(",
"service",
"=",
"'SoftLayer_Virtual_Guest'",
")",
":",
"client",
"=",
"SoftLayer",
".",
"Client",
"(",
"username",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'user'",
",",
"get_configured_provider",
"(",
")",
",",
"__opts__",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_locations | List all available locations | salt/cloud/clouds/softlayer.py | def avail_locations(call=None):
'''
List all available locations
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations function must be called with '
'-f or --function, or with the --list-locations option'
)
ret = {}
conn = get_conn()
... | def avail_locations(call=None):
'''
List all available locations
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations function must be called with '
'-f or --function, or with the --list-locations option'
)
ret = {}
conn = get_conn()
... | [
"List",
"all",
"available",
"locations"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L119-L138 | [
"def",
"avail_locations",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_locations function must be called with '",
"'-f or --function, or with the --list-locations option'",
")",
"ret",
"=",
"{",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_sizes | Return a dict of all available VM sizes on the cloud provider with
relevant data. This data is provided in three dicts. | salt/cloud/clouds/softlayer.py | def avail_sizes(call=None):
'''
Return a dict of all available VM sizes on the cloud provider with
relevant data. This data is provided in three dicts.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_sizes function must be called with '
'-f or --functio... | def avail_sizes(call=None):
'''
Return a dict of all available VM sizes on the cloud provider with
relevant data. This data is provided in three dicts.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_sizes function must be called with '
'-f or --functio... | [
"Return",
"a",
"dict",
"of",
"all",
"available",
"VM",
"sizes",
"on",
"the",
"cloud",
"provider",
"with",
"relevant",
"data",
".",
"This",
"data",
"is",
"provided",
"in",
"three",
"dicts",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L141-L176 | [
"def",
"avail_sizes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_sizes function must be called with '",
"'-f or --function, or with the --list-sizes option'",
")",
"ret",
"=",
"{",
"'block devi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_images | Return a dict of all available VM images on the cloud provider. | salt/cloud/clouds/softlayer.py | def avail_images(call=None):
'''
Return a dict of all available VM images on the cloud provider.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_images function must be called with '
'-f or --function, or with the --list-images option'
)
ret = ... | def avail_images(call=None):
'''
Return a dict of all available VM images on the cloud provider.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_images function must be called with '
'-f or --function, or with the --list-images option'
)
ret = ... | [
"Return",
"a",
"dict",
"of",
"all",
"available",
"VM",
"images",
"on",
"the",
"cloud",
"provider",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L179-L197 | [
"def",
"avail_images",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_images function must be called with '",
"'-f or --function, or with the --list-images option'",
")",
"ret",
"=",
"{",
"}",
"c... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_custom_images | Return a dict of all custom VM images on the cloud provider. | salt/cloud/clouds/softlayer.py | def list_custom_images(call=None):
'''
Return a dict of all custom VM images on the cloud provider.
'''
if call != 'function':
raise SaltCloudSystemExit(
'The list_vlans function must be called with -f or --function.'
)
ret = {}
conn = get_conn('SoftLayer_Account')
... | def list_custom_images(call=None):
'''
Return a dict of all custom VM images on the cloud provider.
'''
if call != 'function':
raise SaltCloudSystemExit(
'The list_vlans function must be called with -f or --function.'
)
ret = {}
conn = get_conn('SoftLayer_Account')
... | [
"Return",
"a",
"dict",
"of",
"all",
"custom",
"VM",
"images",
"on",
"the",
"cloud",
"provider",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L200-L222 | [
"def",
"list_custom_images",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_vlans function must be called with -f or --function.'",
")",
"ret",
"=",
"{",
"}",
"conn",
"=",
"get_conn",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a single VM from a data dict | salt/cloud/clouds/softlayer.py | def create(vm_):
'''
Create a single VM from a data dict
'''
try:
# Check for required profile parameters before sending any API calls.
if vm_['profile'] and config.is_profile_configured(__opts__,
__active_provider_name__ or 'sof... | def create(vm_):
'''
Create a single VM from a data dict
'''
try:
# Check for required profile parameters before sending any API calls.
if vm_['profile'] and config.is_profile_configured(__opts__,
__active_provider_name__ or 'sof... | [
"Create",
"a",
"single",
"VM",
"from",
"a",
"data",
"dict"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L244-L523 | [
"def",
"create",
"(",
"vm_",
")",
":",
"try",
":",
"# Check for required profile parameters before sending any API calls.",
"if",
"vm_",
"[",
"'profile'",
"]",
"and",
"config",
".",
"is_profile_configured",
"(",
"__opts__",
",",
"__active_provider_name__",
"or",
"'softl... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes_full | Return a list of the VMs that are on the provider | salt/cloud/clouds/softlayer.py | def list_nodes_full(mask='mask[id]', call=None):
'''
Return a list of the VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or --function.'
)
ret = {}
conn = get_conn(service='SoftLay... | def list_nodes_full(mask='mask[id]', call=None):
'''
Return a list of the VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or --function.'
)
ret = {}
conn = get_conn(service='SoftLay... | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"are",
"on",
"the",
"provider"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L526-L542 | [
"def",
"list_nodes_full",
"(",
"mask",
"=",
"'mask[id]'",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_full function must be called with -f or --function.'",
")",
"ret",
"=",
"{",
"}",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes | Return a list of the VMs that are on the provider | salt/cloud/clouds/softlayer.py | def list_nodes(call=None):
'''
Return a list of the VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
ret = {}
nodes = list_nodes_full()
if 'error' in nodes:
... | def list_nodes(call=None):
'''
Return a list of the VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
ret = {}
nodes = list_nodes_full()
if 'error' in nodes:
... | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"are",
"on",
"the",
"provider"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L545-L574 | [
"def",
"list_nodes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes function must be called with -f or --function.'",
")",
"ret",
"=",
"{",
"}",
"nodes",
"=",
"list_nodes_full",
"(",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy | Destroy a node.
CLI Example:
.. code-block:: bash
salt-cloud --destroy mymachine | salt/cloud/clouds/softlayer.py | def destroy(name, call=None):
'''
Destroy a node.
CLI Example:
.. code-block:: bash
salt-cloud --destroy mymachine
'''
if call == 'function':
raise SaltCloudSystemExit(
'The destroy action must be called with -d, --destroy, '
'-a or --action.'
)... | def destroy(name, call=None):
'''
Destroy a node.
CLI Example:
.. code-block:: bash
salt-cloud --destroy mymachine
'''
if call == 'function':
raise SaltCloudSystemExit(
'The destroy action must be called with -d, --destroy, '
'-a or --action.'
)... | [
"Destroy",
"a",
"node",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer.py#L600-L640 | [
"def",
"destroy",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The destroy action must be called with -d, --destroy, '",
"'-a or --action.'",
")",
"__utils__",
"[",
"'cloud.fire_event'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | new_set | .. versionadded:: 2014.7.0
Create new custom set
CLI Example:
.. code-block:: bash
salt '*' ipset.new_set custom_set list:set
salt '*' ipset.new_set custom_set list:set comment=True
IPv6:
salt '*' ipset.new_set custom_set list:set family=ipv6 | salt/modules/ipset.py | def new_set(set=None, set_type=None, family='ipv4', comment=False, **kwargs):
'''
.. versionadded:: 2014.7.0
Create new custom set
CLI Example:
.. code-block:: bash
salt '*' ipset.new_set custom_set list:set
salt '*' ipset.new_set custom_set list:set comment=True
IPv6:
... | def new_set(set=None, set_type=None, family='ipv4', comment=False, **kwargs):
'''
.. versionadded:: 2014.7.0
Create new custom set
CLI Example:
.. code-block:: bash
salt '*' ipset.new_set custom_set list:set
salt '*' ipset.new_set custom_set list:set comment=True
IPv6:
... | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L146-L199 | [
"def",
"new_set",
"(",
"set",
"=",
"None",
",",
"set_type",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
",",
"comment",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"ipset_family",
"=",
"_IPSET_FAMILIES",
"[",
"family",
"]",
"if",
"not",
"set",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_set | .. versionadded:: 2014.7.0
Delete ipset set.
CLI Example:
.. code-block:: bash
salt '*' ipset.delete_set custom_set
IPv6:
salt '*' ipset.delete_set custom_set family=ipv6 | salt/modules/ipset.py | def delete_set(set=None, family='ipv4'):
'''
.. versionadded:: 2014.7.0
Delete ipset set.
CLI Example:
.. code-block:: bash
salt '*' ipset.delete_set custom_set
IPv6:
salt '*' ipset.delete_set custom_set family=ipv6
'''
if not set:
return 'Error: Set nee... | def delete_set(set=None, family='ipv4'):
'''
.. versionadded:: 2014.7.0
Delete ipset set.
CLI Example:
.. code-block:: bash
salt '*' ipset.delete_set custom_set
IPv6:
salt '*' ipset.delete_set custom_set family=ipv6
'''
if not set:
return 'Error: Set nee... | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L202-L226 | [
"def",
"delete_set",
"(",
"set",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"if",
"not",
"set",
":",
"return",
"'Error: Set needs to be specified'",
"cmd",
"=",
"'{0} destroy {1}'",
".",
"format",
"(",
"_ipset_cmd",
"(",
")",
",",
"set",
")",
"ou... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rename_set | .. versionadded:: 2014.7.0
Delete ipset set.
CLI Example:
.. code-block:: bash
salt '*' ipset.rename_set custom_set new_set=new_set_name
IPv6:
salt '*' ipset.rename_set custom_set new_set=new_set_name family=ipv6 | salt/modules/ipset.py | def rename_set(set=None, new_set=None, family='ipv4'):
'''
.. versionadded:: 2014.7.0
Delete ipset set.
CLI Example:
.. code-block:: bash
salt '*' ipset.rename_set custom_set new_set=new_set_name
IPv6:
salt '*' ipset.rename_set custom_set new_set=new_set_name family=ipv6... | def rename_set(set=None, new_set=None, family='ipv4'):
'''
.. versionadded:: 2014.7.0
Delete ipset set.
CLI Example:
.. code-block:: bash
salt '*' ipset.rename_set custom_set new_set=new_set_name
IPv6:
salt '*' ipset.rename_set custom_set new_set=new_set_name family=ipv6... | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L229-L264 | [
"def",
"rename_set",
"(",
"set",
"=",
"None",
",",
"new_set",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"if",
"not",
"set",
":",
"return",
"'Error: Set needs to be specified'",
"if",
"not",
"new_set",
":",
"return",
"'Error: New name for set needs to ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_sets | .. versionadded:: 2014.7.0
List all ipset sets.
CLI Example:
.. code-block:: bash
salt '*' ipset.list_sets | salt/modules/ipset.py | def list_sets(family='ipv4'):
'''
.. versionadded:: 2014.7.0
List all ipset sets.
CLI Example:
.. code-block:: bash
salt '*' ipset.list_sets
'''
cmd = '{0} list -t'.format(_ipset_cmd())
out = __salt__['cmd.run'](cmd, python_shell=False)
_tmp = out.split('\n')
count... | def list_sets(family='ipv4'):
'''
.. versionadded:: 2014.7.0
List all ipset sets.
CLI Example:
.. code-block:: bash
salt '*' ipset.list_sets
'''
cmd = '{0} list -t'.format(_ipset_cmd())
out = __salt__['cmd.run'](cmd, python_shell=False)
_tmp = out.split('\n')
count... | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L267-L295 | [
"def",
"list_sets",
"(",
"family",
"=",
"'ipv4'",
")",
":",
"cmd",
"=",
"'{0} list -t'",
".",
"format",
"(",
"_ipset_cmd",
"(",
")",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"_tmp",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_set | Check that given ipset set exists.
.. versionadded:: 2014.7.0
CLI Example:
.. code-block:: bash
salt '*' ipset.check_set setname | salt/modules/ipset.py | def check_set(set=None, family='ipv4'):
'''
Check that given ipset set exists.
.. versionadded:: 2014.7.0
CLI Example:
.. code-block:: bash
salt '*' ipset.check_set setname
'''
if not set:
return 'Error: Set needs to be specified'
setinfo = _find_set_info(set)
i... | def check_set(set=None, family='ipv4'):
'''
Check that given ipset set exists.
.. versionadded:: 2014.7.0
CLI Example:
.. code-block:: bash
salt '*' ipset.check_set setname
'''
if not set:
return 'Error: Set needs to be specified'
setinfo = _find_set_info(set)
i... | [
"Check",
"that",
"given",
"ipset",
"set",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L298-L317 | [
"def",
"check_set",
"(",
"set",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"if",
"not",
"set",
":",
"return",
"'Error: Set needs to be specified'",
"setinfo",
"=",
"_find_set_info",
"(",
"set",
")",
"if",
"not",
"setinfo",
":",
"return",
"False",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add | Append an entry to the specified set.
CLI Example:
.. code-block:: bash
salt '*' ipset.add setname 192.168.1.26
salt '*' ipset.add setname 192.168.0.3,AA:BB:CC:DD:EE:FF | salt/modules/ipset.py | def add(setname=None, entry=None, family='ipv4', **kwargs):
'''
Append an entry to the specified set.
CLI Example:
.. code-block:: bash
salt '*' ipset.add setname 192.168.1.26
salt '*' ipset.add setname 192.168.0.3,AA:BB:CC:DD:EE:FF
'''
if not setname:
return 'Error:... | def add(setname=None, entry=None, family='ipv4', **kwargs):
'''
Append an entry to the specified set.
CLI Example:
.. code-block:: bash
salt '*' ipset.add setname 192.168.1.26
salt '*' ipset.add setname 192.168.0.3,AA:BB:CC:DD:EE:FF
'''
if not setname:
return 'Error:... | [
"Append",
"an",
"entry",
"to",
"the",
"specified",
"set",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L320-L378 | [
"def",
"add",
"(",
"setname",
"=",
"None",
",",
"entry",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"setname",
":",
"return",
"'Error: Set needs to be specified'",
"if",
"not",
"entry",
":",
"return",
"'Err... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check | Check that an entry exists in the specified set.
set
The ipset name
entry
An entry in the ipset. This parameter can be a single IP address, a
range of IP addresses, or a subnet block. Example:
.. code-block:: cfg
192.168.0.1
192.168.0.2-192.168.0.19
... | salt/modules/ipset.py | def check(set=None, entry=None, family='ipv4'):
'''
Check that an entry exists in the specified set.
set
The ipset name
entry
An entry in the ipset. This parameter can be a single IP address, a
range of IP addresses, or a subnet block. Example:
.. code-block:: cfg
... | def check(set=None, entry=None, family='ipv4'):
'''
Check that an entry exists in the specified set.
set
The ipset name
entry
An entry in the ipset. This parameter can be a single IP address, a
range of IP addresses, or a subnet block. Example:
.. code-block:: cfg
... | [
"Check",
"that",
"an",
"entry",
"exists",
"in",
"the",
"specified",
"set",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L410-L461 | [
"def",
"check",
"(",
"set",
"=",
"None",
",",
"entry",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"if",
"not",
"set",
":",
"return",
"'Error: Set needs to be specified'",
"if",
"not",
"entry",
":",
"return",
"'Error: Entry needs to be specified'",
"s... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | flush | Flush entries in the specified set,
Flush all sets if set is not specified.
CLI Example:
.. code-block:: bash
salt '*' ipset.flush
salt '*' ipset.flush set
IPv6:
salt '*' ipset.flush
salt '*' ipset.flush set | salt/modules/ipset.py | def flush(set=None, family='ipv4'):
'''
Flush entries in the specified set,
Flush all sets if set is not specified.
CLI Example:
.. code-block:: bash
salt '*' ipset.flush
salt '*' ipset.flush set
IPv6:
salt '*' ipset.flush
salt '*' ipset.flush set
''... | def flush(set=None, family='ipv4'):
'''
Flush entries in the specified set,
Flush all sets if set is not specified.
CLI Example:
.. code-block:: bash
salt '*' ipset.flush
salt '*' ipset.flush set
IPv6:
salt '*' ipset.flush
salt '*' ipset.flush set
''... | [
"Flush",
"entries",
"in",
"the",
"specified",
"set",
"Flush",
"all",
"sets",
"if",
"set",
"is",
"not",
"specified",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L496-L526 | [
"def",
"flush",
"(",
"set",
"=",
"None",
",",
"family",
"=",
"'ipv4'",
")",
":",
"settype",
"=",
"_find_set_type",
"(",
"set",
")",
"if",
"not",
"settype",
":",
"return",
"'Error: Set {0} does not exist'",
".",
"format",
"(",
"set",
")",
"ipset_family",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_set_members | Return list of members for a set | salt/modules/ipset.py | def _find_set_members(set):
'''
Return list of members for a set
'''
cmd = '{0} list {1}'.format(_ipset_cmd(), set)
out = __salt__['cmd.run_all'](cmd, python_shell=False)
if out['retcode'] > 0:
# Set doesn't exist return false
return False
_tmp = out['stdout'].split('\n')
... | def _find_set_members(set):
'''
Return list of members for a set
'''
cmd = '{0} list {1}'.format(_ipset_cmd(), set)
out = __salt__['cmd.run_all'](cmd, python_shell=False)
if out['retcode'] > 0:
# Set doesn't exist return false
return False
_tmp = out['stdout'].split('\n')
... | [
"Return",
"list",
"of",
"members",
"for",
"a",
"set"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L529-L549 | [
"def",
"_find_set_members",
"(",
"set",
")",
":",
"cmd",
"=",
"'{0} list {1}'",
".",
"format",
"(",
"_ipset_cmd",
"(",
")",
",",
"set",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"if",
"o... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_set_info | Return information about the set | salt/modules/ipset.py | def _find_set_info(set):
'''
Return information about the set
'''
cmd = '{0} list -t {1}'.format(_ipset_cmd(), set)
out = __salt__['cmd.run_all'](cmd, python_shell=False)
if out['retcode'] > 0:
# Set doesn't exist return false
return False
setinfo = {}
_tmp = out['stdo... | def _find_set_info(set):
'''
Return information about the set
'''
cmd = '{0} list -t {1}'.format(_ipset_cmd(), set)
out = __salt__['cmd.run_all'](cmd, python_shell=False)
if out['retcode'] > 0:
# Set doesn't exist return false
return False
setinfo = {}
_tmp = out['stdo... | [
"Return",
"information",
"about",
"the",
"set"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipset.py#L552-L571 | [
"def",
"_find_set_info",
"(",
"set",
")",
":",
"cmd",
"=",
"'{0} list -t {1}'",
".",
"format",
"(",
"_ipset_cmd",
"(",
")",
",",
"set",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
"if",
"o... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | query | Query a resource, and decode the return data
Passes through all the parameters described in the
:py:func:`utils.http.query function <salt.utils.http.query>`:
CLI Example:
.. code-block:: bash
salt-run http.query http://somelink.com/
salt-run http.query http://somelink.com/ method=POS... | salt/runners/http.py | def query(url, output=True, **kwargs):
'''
Query a resource, and decode the return data
Passes through all the parameters described in the
:py:func:`utils.http.query function <salt.utils.http.query>`:
CLI Example:
.. code-block:: bash
salt-run http.query http://somelink.com/
... | def query(url, output=True, **kwargs):
'''
Query a resource, and decode the return data
Passes through all the parameters described in the
:py:func:`utils.http.query function <salt.utils.http.query>`:
CLI Example:
.. code-block:: bash
salt-run http.query http://somelink.com/
... | [
"Query",
"a",
"resource",
"and",
"decode",
"the",
"return",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/http.py#L18-L45 | [
"def",
"query",
"(",
"url",
",",
"output",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"output",
"is",
"not",
"True",
":",
"log",
".",
"warning",
"(",
"'Output option has been deprecated. Please use --quiet.'",
")",
"if",
"'node'",
"not",
"in",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_ca_bundle | Update the local CA bundle file from a URL
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt-run http.update_ca_bundle
salt-run http.update_ca_bundle target=/path/to/cacerts.pem
salt-run http.update_ca_bundle source=https://example.com/cacerts.pem
If the ``ta... | salt/runners/http.py | def update_ca_bundle(target=None, source=None, merge_files=None):
'''
Update the local CA bundle file from a URL
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt-run http.update_ca_bundle
salt-run http.update_ca_bundle target=/path/to/cacerts.pem
salt-run... | def update_ca_bundle(target=None, source=None, merge_files=None):
'''
Update the local CA bundle file from a URL
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt-run http.update_ca_bundle
salt-run http.update_ca_bundle target=/path/to/cacerts.pem
salt-run... | [
"Update",
"the",
"local",
"CA",
"bundle",
"file",
"from",
"a",
"URL"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/http.py#L48-L83 | [
"def",
"update_ca_bundle",
"(",
"target",
"=",
"None",
",",
"source",
"=",
"None",
",",
"merge_files",
"=",
"None",
")",
":",
"return",
"salt",
".",
"utils",
".",
"http",
".",
"update_ca_bundle",
"(",
"target",
",",
"source",
",",
"__opts__",
",",
"merge... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure that a user is present.
name
Name of the user.
password
Password of the user.
email
Optional - Email of the user.
is_admin
Optional - Set user as admin user. Default: False
fullname
Optional - Full name of the user.
theme
Optional - Se... | salt/states/grafana4_user.py | def present(name,
password,
email=None,
is_admin=False,
fullname=None,
theme=None,
default_organization=None,
organizations=None,
profile='grafana'):
'''
Ensure that a user is present.
name
Name of the u... | def present(name,
password,
email=None,
is_admin=False,
fullname=None,
theme=None,
default_organization=None,
organizations=None,
profile='grafana'):
'''
Ensure that a user is present.
name
Name of the u... | [
"Ensure",
"that",
"a",
"user",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana4_user.py#L55-L187 | [
"def",
"present",
"(",
"name",
",",
"password",
",",
"email",
"=",
"None",
",",
"is_admin",
"=",
"False",
",",
"fullname",
"=",
"None",
",",
"theme",
"=",
"None",
",",
"default_organization",
"=",
"None",
",",
"organizations",
"=",
"None",
",",
"profile"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure that a user is present.
name
Name of the user to remove.
profile
Configuration profile used to connect to the Grafana instance.
Default is 'grafana'. | salt/states/grafana4_user.py | def absent(name, profile='grafana'):
'''
Ensure that a user is present.
name
Name of the user to remove.
profile
Configuration profile used to connect to the Grafana instance.
Default is 'grafana'.
'''
if isinstance(profile, string_types):
profile = __salt__['co... | def absent(name, profile='grafana'):
'''
Ensure that a user is present.
name
Name of the user to remove.
profile
Configuration profile used to connect to the Grafana instance.
Default is 'grafana'.
'''
if isinstance(profile, string_types):
profile = __salt__['co... | [
"Ensure",
"that",
"a",
"user",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana4_user.py#L190-L231 | [
"def",
"absent",
"(",
"name",
",",
"profile",
"=",
"'grafana'",
")",
":",
"if",
"isinstance",
"(",
"profile",
",",
"string_types",
")",
":",
"profile",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"profile",
")",
"ret",
"=",
"{",
"'name'",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create the named vm
CLI Example:
.. code-block:: bash
salt <minion-id> saltcloud.create webserver rackspace_centos_512 | salt/modules/saltcloudmod.py | def create(name, profile):
'''
Create the named vm
CLI Example:
.. code-block:: bash
salt <minion-id> saltcloud.create webserver rackspace_centos_512
'''
cmd = 'salt-cloud --out json -p {0} {1}'.format(profile, name)
out = __salt__['cmd.run_stdout'](cmd, python_shell=False)
tr... | def create(name, profile):
'''
Create the named vm
CLI Example:
.. code-block:: bash
salt <minion-id> saltcloud.create webserver rackspace_centos_512
'''
cmd = 'salt-cloud --out json -p {0} {1}'.format(profile, name)
out = __salt__['cmd.run_stdout'](cmd, python_shell=False)
tr... | [
"Create",
"the",
"named",
"vm"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltcloudmod.py#L32-L48 | [
"def",
"create",
"(",
"name",
",",
"profile",
")",
":",
"cmd",
"=",
"'salt-cloud --out json -p {0} {1}'",
".",
"format",
"(",
"profile",
",",
"name",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure that the named database is present with the specified properties.
For more information about all of these options see man createdb(1)
name
The name of the database to manage
tablespace
Default tablespace for the database
encoding
The character encoding scheme to be used... | salt/states/postgres_database.py | def present(name,
tablespace=None,
encoding=None,
lc_collate=None,
lc_ctype=None,
owner=None,
owner_recurse=False,
template=None,
user=None,
maintenance_db=None,
db_password=None,
db_host=... | def present(name,
tablespace=None,
encoding=None,
lc_collate=None,
lc_ctype=None,
owner=None,
owner_recurse=False,
template=None,
user=None,
maintenance_db=None,
db_password=None,
db_host=... | [
"Ensure",
"that",
"the",
"named",
"database",
"is",
"present",
"with",
"the",
"specified",
"properties",
".",
"For",
"more",
"information",
"about",
"all",
"of",
"these",
"options",
"see",
"man",
"createdb",
"(",
"1",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_database.py#L26-L161 | [
"def",
"present",
"(",
"name",
",",
"tablespace",
"=",
"None",
",",
"encoding",
"=",
"None",
",",
"lc_collate",
"=",
"None",
",",
"lc_ctype",
"=",
"None",
",",
"owner",
"=",
"None",
",",
"owner_recurse",
"=",
"False",
",",
"template",
"=",
"None",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | profile_list | List all available profiles
default_only : boolean
return only default profile
CLI Example:
.. code-block:: bash
salt '*' rbac.profile_list | salt/modules/rbac_solaris.py | def profile_list(default_only=False):
'''
List all available profiles
default_only : boolean
return only default profile
CLI Example:
.. code-block:: bash
salt '*' rbac.profile_list
'''
profiles = {}
default_profiles = ['All']
## lookup default profile(s)
wit... | def profile_list(default_only=False):
'''
List all available profiles
default_only : boolean
return only default profile
CLI Example:
.. code-block:: bash
salt '*' rbac.profile_list
'''
profiles = {}
default_profiles = ['All']
## lookup default profile(s)
wit... | [
"List",
"all",
"available",
"profiles"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L34-L76 | [
"def",
"profile_list",
"(",
"default_only",
"=",
"False",
")",
":",
"profiles",
"=",
"{",
"}",
"default_profiles",
"=",
"[",
"'All'",
"]",
"## lookup default profile(s)",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"'/etc/security/policy.conf'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | profile_get | List profiles for user
user : string
username
default_hidden : boolean
hide default profiles
CLI Example:
.. code-block:: bash
salt '*' rbac.profile_get leo
salt '*' rbac.profile_get leo default_hidden=False | salt/modules/rbac_solaris.py | def profile_get(user, default_hidden=True):
'''
List profiles for user
user : string
username
default_hidden : boolean
hide default profiles
CLI Example:
.. code-block:: bash
salt '*' rbac.profile_get leo
salt '*' rbac.profile_get leo default_hidden=False
... | def profile_get(user, default_hidden=True):
'''
List profiles for user
user : string
username
default_hidden : boolean
hide default profiles
CLI Example:
.. code-block:: bash
salt '*' rbac.profile_get leo
salt '*' rbac.profile_get leo default_hidden=False
... | [
"List",
"profiles",
"for",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L79-L128 | [
"def",
"profile_get",
"(",
"user",
",",
"default_hidden",
"=",
"True",
")",
":",
"user_profiles",
"=",
"[",
"]",
"## read user_attr file (user:qualifier:res1:res2:attr)",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"'/etc/user_attr'",
",",
"'r'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | profile_add | Add profile to user
user : string
username
profile : string
profile name
CLI Example:
.. code-block:: bash
salt '*' rbac.profile_add martine 'Primary Administrator'
salt '*' rbac.profile_add martine 'User Management,User Security' | salt/modules/rbac_solaris.py | def profile_add(user, profile):
'''
Add profile to user
user : string
username
profile : string
profile name
CLI Example:
.. code-block:: bash
salt '*' rbac.profile_add martine 'Primary Administrator'
salt '*' rbac.profile_add martine 'User Management,User Sec... | def profile_add(user, profile):
'''
Add profile to user
user : string
username
profile : string
profile name
CLI Example:
.. code-block:: bash
salt '*' rbac.profile_add martine 'Primary Administrator'
salt '*' rbac.profile_add martine 'User Management,User Sec... | [
"Add",
"profile",
"to",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L131-L183 | [
"def",
"profile_add",
"(",
"user",
",",
"profile",
")",
":",
"ret",
"=",
"{",
"}",
"## validate profiles",
"profiles",
"=",
"profile",
".",
"split",
"(",
"','",
")",
"known_profiles",
"=",
"profile_list",
"(",
")",
".",
"keys",
"(",
")",
"valid_profiles",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | role_list | List all available roles
CLI Example:
.. code-block:: bash
salt '*' rbac.role_list | salt/modules/rbac_solaris.py | def role_list():
'''
List all available roles
CLI Example:
.. code-block:: bash
salt '*' rbac.role_list
'''
roles = {}
## read user_attr file (user:qualifier:res1:res2:attr)
with salt.utils.files.fopen('/etc/user_attr', 'r') as user_attr:
for role in user_attr:
... | def role_list():
'''
List all available roles
CLI Example:
.. code-block:: bash
salt '*' rbac.role_list
'''
roles = {}
## read user_attr file (user:qualifier:res1:res2:attr)
with salt.utils.files.fopen('/etc/user_attr', 'r') as user_attr:
for role in user_attr:
... | [
"List",
"all",
"available",
"roles"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L241-L278 | [
"def",
"role_list",
"(",
")",
":",
"roles",
"=",
"{",
"}",
"## read user_attr file (user:qualifier:res1:res2:attr)",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"'/etc/user_attr'",
",",
"'r'",
")",
"as",
"user_attr",
":",
"for",
"role",
"in"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | role_get | List roles for user
user : string
username
CLI Example:
.. code-block:: bash
salt '*' rbac.role_get leo | salt/modules/rbac_solaris.py | def role_get(user):
'''
List roles for user
user : string
username
CLI Example:
.. code-block:: bash
salt '*' rbac.role_get leo
'''
user_roles = []
## read user_attr file (user:qualifier:res1:res2:attr)
with salt.utils.files.fopen('/etc/user_attr', 'r') as user_a... | def role_get(user):
'''
List roles for user
user : string
username
CLI Example:
.. code-block:: bash
salt '*' rbac.role_get leo
'''
user_roles = []
## read user_attr file (user:qualifier:res1:res2:attr)
with salt.utils.files.fopen('/etc/user_attr', 'r') as user_a... | [
"List",
"roles",
"for",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L281-L321 | [
"def",
"role_get",
"(",
"user",
")",
":",
"user_roles",
"=",
"[",
"]",
"## read user_attr file (user:qualifier:res1:res2:attr)",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"'/etc/user_attr'",
",",
"'r'",
")",
"as",
"user_attr",
":",
"for",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | role_add | Add role to user
user : string
username
role : string
role name
CLI Example:
.. code-block:: bash
salt '*' rbac.role_add martine netcfg
salt '*' rbac.role_add martine netcfg,zfssnap | salt/modules/rbac_solaris.py | def role_add(user, role):
'''
Add role to user
user : string
username
role : string
role name
CLI Example:
.. code-block:: bash
salt '*' rbac.role_add martine netcfg
salt '*' rbac.role_add martine netcfg,zfssnap
'''
ret = {}
## validate roles
... | def role_add(user, role):
'''
Add role to user
user : string
username
role : string
role name
CLI Example:
.. code-block:: bash
salt '*' rbac.role_add martine netcfg
salt '*' rbac.role_add martine netcfg,zfssnap
'''
ret = {}
## validate roles
... | [
"Add",
"role",
"to",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L324-L376 | [
"def",
"role_add",
"(",
"user",
",",
"role",
")",
":",
"ret",
"=",
"{",
"}",
"## validate roles",
"roles",
"=",
"role",
".",
"split",
"(",
"','",
")",
"known_roles",
"=",
"role_list",
"(",
")",
".",
"keys",
"(",
")",
"valid_roles",
"=",
"[",
"r",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | auth_list | List all available authorization
CLI Example:
.. code-block:: bash
salt '*' rbac.auth_list | salt/modules/rbac_solaris.py | def auth_list():
'''
List all available authorization
CLI Example:
.. code-block:: bash
salt '*' rbac.auth_list
'''
auths = {}
## read auth_attr file (name:res1:res2:short_desc:long_desc:attr)
with salt.utils.files.fopen('/etc/security/auth_attr', 'r') as auth_attr:
f... | def auth_list():
'''
List all available authorization
CLI Example:
.. code-block:: bash
salt '*' rbac.auth_list
'''
auths = {}
## read auth_attr file (name:res1:res2:short_desc:long_desc:attr)
with salt.utils.files.fopen('/etc/security/auth_attr', 'r') as auth_attr:
f... | [
"List",
"all",
"available",
"authorization"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L434-L461 | [
"def",
"auth_list",
"(",
")",
":",
"auths",
"=",
"{",
"}",
"## read auth_attr file (name:res1:res2:short_desc:long_desc:attr)",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"'/etc/security/auth_attr'",
",",
"'r'",
")",
"as",
"auth_attr",
":",
"fo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | auth_get | List authorization for user
user : string
username
computed : boolean
merge results from `auths` command into data from user_attr
CLI Example:
.. code-block:: bash
salt '*' rbac.auth_get leo | salt/modules/rbac_solaris.py | def auth_get(user, computed=True):
'''
List authorization for user
user : string
username
computed : boolean
merge results from `auths` command into data from user_attr
CLI Example:
.. code-block:: bash
salt '*' rbac.auth_get leo
'''
user_auths = []
## re... | def auth_get(user, computed=True):
'''
List authorization for user
user : string
username
computed : boolean
merge results from `auths` command into data from user_attr
CLI Example:
.. code-block:: bash
salt '*' rbac.auth_get leo
'''
user_auths = []
## re... | [
"List",
"authorization",
"for",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L464-L516 | [
"def",
"auth_get",
"(",
"user",
",",
"computed",
"=",
"True",
")",
":",
"user_auths",
"=",
"[",
"]",
"## read user_attr file (user:qualifier:res1:res2:attr)",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"'/etc/user_attr'",
",",
"'r'",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | auth_add | Add authorization to user
user : string
username
auth : string
authorization name
CLI Example:
.. code-block:: bash
salt '*' rbac.auth_add martine solaris.zone.manage
salt '*' rbac.auth_add martine solaris.zone.manage,solaris.mail.mailq | salt/modules/rbac_solaris.py | def auth_add(user, auth):
'''
Add authorization to user
user : string
username
auth : string
authorization name
CLI Example:
.. code-block:: bash
salt '*' rbac.auth_add martine solaris.zone.manage
salt '*' rbac.auth_add martine solaris.zone.manage,solaris.mail... | def auth_add(user, auth):
'''
Add authorization to user
user : string
username
auth : string
authorization name
CLI Example:
.. code-block:: bash
salt '*' rbac.auth_add martine solaris.zone.manage
salt '*' rbac.auth_add martine solaris.zone.manage,solaris.mail... | [
"Add",
"authorization",
"to",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbac_solaris.py#L519-L571 | [
"def",
"auth_add",
"(",
"user",
",",
"auth",
")",
":",
"ret",
"=",
"{",
"}",
"## validate auths",
"auths",
"=",
"auth",
".",
"split",
"(",
"','",
")",
"known_auths",
"=",
"auth_list",
"(",
")",
".",
"keys",
"(",
")",
"valid_auths",
"=",
"[",
"r",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | term | Manage the configuration of a specific policy term.
filter_name
The name of the policy filter.
term_name
The name of the term.
filter_options
Additional filter options. These options are platform-specific.
See the complete list of options_.
.. _options: https://gi... | salt/states/netacl.py | def term(name,
filter_name,
term_name,
filter_options=None,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=False,
revision_id=None,
revision_no=None,
revision_date=True,
revision_date_format='%Y/%m/%d',
... | def term(name,
filter_name,
term_name,
filter_options=None,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=False,
revision_id=None,
revision_no=None,
revision_date=True,
revision_date_format='%Y/%m/%d',
... | [
"Manage",
"the",
"configuration",
"of",
"a",
"specific",
"policy",
"term",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netacl.py#L89-L441 | [
"def",
"term",
"(",
"name",
",",
"filter_name",
",",
"term_name",
",",
"filter_options",
"=",
"None",
",",
"pillar_key",
"=",
"'acl'",
",",
"pillarenv",
"=",
"None",
",",
"saltenv",
"=",
"None",
",",
"merge_pillar",
"=",
"False",
",",
"revision_id",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | filter | Generate and load the configuration of a policy filter.
filter_name
The name of the policy filter.
filter_options
Additional filter options. These options are platform-specific.
See the complete list of options_.
.. _options: https://github.com/google/capirca/wiki/Policy-forma... | salt/states/netacl.py | def filter(name, # pylint: disable=redefined-builtin
filter_name,
filter_options=None,
terms=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=False,
only_lower_merge=False,
revi... | def filter(name, # pylint: disable=redefined-builtin
filter_name,
filter_options=None,
terms=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=False,
only_lower_merge=False,
revi... | [
"Generate",
"and",
"load",
"the",
"configuration",
"of",
"a",
"policy",
"filter",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netacl.py#L444-L672 | [
"def",
"filter",
"(",
"name",
",",
"# pylint: disable=redefined-builtin",
"filter_name",
",",
"filter_options",
"=",
"None",
",",
"terms",
"=",
"None",
",",
"prepend",
"=",
"True",
",",
"pillar_key",
"=",
"'acl'",
",",
"pillarenv",
"=",
"None",
",",
"saltenv",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_sys | Get current system keyboard setting
CLI Example:
.. code-block:: bash
salt '*' keyboard.get_sys | salt/modules/keyboard.py | def get_sys():
'''
Get current system keyboard setting
CLI Example:
.. code-block:: bash
salt '*' keyboard.get_sys
'''
cmd = ''
if salt.utils.path.which('localectl'):
cmd = 'localectl | grep Keymap | sed -e"s/: /=/" -e"s/^[ \t]*//"'
elif 'RedHat' in __grains__['os_fami... | def get_sys():
'''
Get current system keyboard setting
CLI Example:
.. code-block:: bash
salt '*' keyboard.get_sys
'''
cmd = ''
if salt.utils.path.which('localectl'):
cmd = 'localectl | grep Keymap | sed -e"s/: /=/" -e"s/^[ \t]*//"'
elif 'RedHat' in __grains__['os_fami... | [
"Get",
"current",
"system",
"keyboard",
"setting"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keyboard.py#L28-L49 | [
"def",
"get_sys",
"(",
")",
":",
"cmd",
"=",
"''",
"if",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'localectl'",
")",
":",
"cmd",
"=",
"'localectl | grep Keymap | sed -e\"s/: /=/\" -e\"s/^[ \\t]*//\"'",
"elif",
"'RedHat'",
"in",
"__grains__",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_sys | Set current system keyboard setting
CLI Example:
.. code-block:: bash
salt '*' keyboard.set_sys dvorak | salt/modules/keyboard.py | def set_sys(layout):
'''
Set current system keyboard setting
CLI Example:
.. code-block:: bash
salt '*' keyboard.set_sys dvorak
'''
if salt.utils.path.which('localectl'):
__salt__['cmd.run']('localectl set-keymap {0}'.format(layout))
elif 'RedHat' in __grains__['os_family'... | def set_sys(layout):
'''
Set current system keyboard setting
CLI Example:
.. code-block:: bash
salt '*' keyboard.set_sys dvorak
'''
if salt.utils.path.which('localectl'):
__salt__['cmd.run']('localectl set-keymap {0}'.format(layout))
elif 'RedHat' in __grains__['os_family'... | [
"Set",
"current",
"system",
"keyboard",
"setting"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keyboard.py#L52-L76 | [
"def",
"set_sys",
"(",
"layout",
")",
":",
"if",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'localectl'",
")",
":",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'localectl set-keymap {0}'",
".",
"format",
"(",
"layout",
")",
")",
"elif",
"'RedHat... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_x | Get current X keyboard setting
CLI Example:
.. code-block:: bash
salt '*' keyboard.get_x | salt/modules/keyboard.py | def get_x():
'''
Get current X keyboard setting
CLI Example:
.. code-block:: bash
salt '*' keyboard.get_x
'''
cmd = 'setxkbmap -query | grep layout'
out = __salt__['cmd.run'](cmd, python_shell=True).split(':')
return out[1].strip() | def get_x():
'''
Get current X keyboard setting
CLI Example:
.. code-block:: bash
salt '*' keyboard.get_x
'''
cmd = 'setxkbmap -query | grep layout'
out = __salt__['cmd.run'](cmd, python_shell=True).split(':')
return out[1].strip() | [
"Get",
"current",
"X",
"keyboard",
"setting"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keyboard.py#L79-L91 | [
"def",
"get_x",
"(",
")",
":",
"cmd",
"=",
"'setxkbmap -query | grep layout'",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"True",
")",
".",
"split",
"(",
"':'",
")",
"return",
"out",
"[",
"1",
"]",
".",
"strip"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | secure_password | Generate a secure password. | salt/utils/pycrypto.py | def secure_password(length=20, use_random=True):
'''
Generate a secure password.
'''
try:
length = int(length)
pw = ''
while len(pw) < length:
if HAS_RANDOM and use_random:
while True:
try:
char = salt.utils.... | def secure_password(length=20, use_random=True):
'''
Generate a secure password.
'''
try:
length = int(length)
pw = ''
while len(pw) < length:
if HAS_RANDOM and use_random:
while True:
try:
char = salt.utils.... | [
"Generate",
"a",
"secure",
"password",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pycrypto.py#L41-L66 | [
"def",
"secure_password",
"(",
"length",
"=",
"20",
",",
"use_random",
"=",
"True",
")",
":",
"try",
":",
"length",
"=",
"int",
"(",
"length",
")",
"pw",
"=",
"''",
"while",
"len",
"(",
"pw",
")",
"<",
"length",
":",
"if",
"HAS_RANDOM",
"and",
"use... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | gen_hash | Generate /etc/shadow hash | salt/utils/pycrypto.py | def gen_hash(crypt_salt=None, password=None, algorithm='sha512'):
'''
Generate /etc/shadow hash
'''
if not HAS_CRYPT:
raise SaltInvocationError('No crypt module for windows')
hash_algorithms = dict(
md5='$1$', blowfish='$2a$', sha256='$5$', sha512='$6$'
)
if algorithm not in... | def gen_hash(crypt_salt=None, password=None, algorithm='sha512'):
'''
Generate /etc/shadow hash
'''
if not HAS_CRYPT:
raise SaltInvocationError('No crypt module for windows')
hash_algorithms = dict(
md5='$1$', blowfish='$2a$', sha256='$5$', sha512='$6$'
)
if algorithm not in... | [
"Generate",
"/",
"etc",
"/",
"shadow",
"hash"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pycrypto.py#L69-L92 | [
"def",
"gen_hash",
"(",
"crypt_salt",
"=",
"None",
",",
"password",
"=",
"None",
",",
"algorithm",
"=",
"'sha512'",
")",
":",
"if",
"not",
"HAS_CRYPT",
":",
"raise",
"SaltInvocationError",
"(",
"'No crypt module for windows'",
")",
"hash_algorithms",
"=",
"dict"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_hash | Jenkins One-At-A-Time Hash Function
More Info: http://en.wikipedia.org/wiki/Jenkins_hash_function#one-at-a-time | salt/executors/splay.py | def _get_hash():
'''
Jenkins One-At-A-Time Hash Function
More Info: http://en.wikipedia.org/wiki/Jenkins_hash_function#one-at-a-time
'''
# Using bitmask to emulate rollover behavior of C unsigned 32 bit int
bitmask = 0xffffffff
h = 0
for i in bytearray(salt.utils.stringutils.to_bytes(__... | def _get_hash():
'''
Jenkins One-At-A-Time Hash Function
More Info: http://en.wikipedia.org/wiki/Jenkins_hash_function#one-at-a-time
'''
# Using bitmask to emulate rollover behavior of C unsigned 32 bit int
bitmask = 0xffffffff
h = 0
for i in bytearray(salt.utils.stringutils.to_bytes(__... | [
"Jenkins",
"One",
"-",
"At",
"-",
"A",
"-",
"Time",
"Hash",
"Function",
"More",
"Info",
":",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Jenkins_hash_function#one",
"-",
"at",
"-",
"a",
"-",
"time"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/executors/splay.py#L24-L42 | [
"def",
"_get_hash",
"(",
")",
":",
"# Using bitmask to emulate rollover behavior of C unsigned 32 bit int",
"bitmask",
"=",
"0xffffffff",
"h",
"=",
"0",
"for",
"i",
"in",
"bytearray",
"(",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_bytes",
"(",
"__grains__",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | execute | Splay a salt function call execution time across minions over
a number of seconds (default: 300)
.. note::
You *probably* want to use --async here and look up the job results later.
If you're dead set on getting the output from the CLI command, then make
sure to set the timeout (with th... | salt/executors/splay.py | def execute(opts, data, func, args, kwargs):
'''
Splay a salt function call execution time across minions over
a number of seconds (default: 300)
.. note::
You *probably* want to use --async here and look up the job results later.
If you're dead set on getting the output from the CLI co... | def execute(opts, data, func, args, kwargs):
'''
Splay a salt function call execution time across minions over
a number of seconds (default: 300)
.. note::
You *probably* want to use --async here and look up the job results later.
If you're dead set on getting the output from the CLI co... | [
"Splay",
"a",
"salt",
"function",
"call",
"execution",
"time",
"across",
"minions",
"over",
"a",
"number",
"of",
"seconds",
"(",
"default",
":",
"300",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/executors/splay.py#L49-L84 | [
"def",
"execute",
"(",
"opts",
",",
"data",
",",
"func",
",",
"args",
",",
"kwargs",
")",
":",
"if",
"'executor_opts'",
"in",
"data",
"and",
"'splaytime'",
"in",
"data",
"[",
"'executor_opts'",
"]",
":",
"splaytime",
"=",
"data",
"[",
"'executor_opts'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure that the named index is absent.
name
Name of the index to remove | salt/states/elasticsearch_index.py | def absent(name):
'''
Ensure that the named index is absent.
name
Name of the index to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
index = __salt__['elasticsearch.index_get'](index=name)
if index and name in index:
if ... | def absent(name):
'''
Ensure that the named index is absent.
name
Name of the index to remove
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
try:
index = __salt__['elasticsearch.index_get'](index=name)
if index and name in index:
if ... | [
"Ensure",
"that",
"the",
"named",
"index",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch_index.py#L19-L49 | [
"def",
"absent",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"index",
"=",
"__salt__",
"[",
"'elasticsearch.index_get'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | .. versionadded:: 2015.8.0
.. versionchanged:: 2017.3.0
Marked ``definition`` as optional.
Ensure that the named index is present.
name
Name of the index to add
definition
Optional dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/curr... | salt/states/elasticsearch_index.py | def present(name, definition=None):
'''
.. versionadded:: 2015.8.0
.. versionchanged:: 2017.3.0
Marked ``definition`` as optional.
Ensure that the named index is present.
name
Name of the index to add
definition
Optional dict for creation parameters as per https://www.... | def present(name, definition=None):
'''
.. versionadded:: 2015.8.0
.. versionchanged:: 2017.3.0
Marked ``definition`` as optional.
Ensure that the named index is present.
name
Name of the index to add
definition
Optional dict for creation parameters as per https://www.... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0",
"..",
"versionchanged",
"::",
"2017",
".",
"3",
".",
"0",
"Marked",
"definition",
"as",
"optional",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/elasticsearch_index.py#L52-L106 | [
"def",
"present",
"(",
"name",
",",
"definition",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"try",
":",
"index_exists",
"=",
"__sa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _cmd | Return full path to service command
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs | salt/modules/freebsdservice.py | def _cmd(jail=None):
'''
Return full path to service command
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
'''
service = salt.utils.path.which('service')
if not service:
raise CommandNotFoundError('\'service\' command not f... | def _cmd(jail=None):
'''
Return full path to service command
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
'''
service = salt.utils.path.which('service')
if not service:
raise CommandNotFoundError('\'service\' command not f... | [
"Return",
"full",
"path",
"to",
"service",
"command"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L46-L62 | [
"def",
"_cmd",
"(",
"jail",
"=",
"None",
")",
":",
"service",
"=",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'service'",
")",
"if",
"not",
"service",
":",
"raise",
"CommandNotFoundError",
"(",
"'\\'service\\' command not found'",
")",
"if",
"j... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_jail_path | .. versionadded:: 2016.3.4
Return the jail's root directory (path) as shown in jls
jail
The jid or jail name | salt/modules/freebsdservice.py | def _get_jail_path(jail):
'''
.. versionadded:: 2016.3.4
Return the jail's root directory (path) as shown in jls
jail
The jid or jail name
'''
jls = salt.utils.path.which('jls')
if not jls:
raise CommandNotFoundError('\'jls\' command not found')
jails = __salt__['cmd.ru... | def _get_jail_path(jail):
'''
.. versionadded:: 2016.3.4
Return the jail's root directory (path) as shown in jls
jail
The jid or jail name
'''
jls = salt.utils.path.which('jls')
if not jls:
raise CommandNotFoundError('\'jls\' command not found')
jails = __salt__['cmd.ru... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"4"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L65-L83 | [
"def",
"_get_jail_path",
"(",
"jail",
")",
":",
"jls",
"=",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'jls'",
")",
"if",
"not",
"jls",
":",
"raise",
"CommandNotFoundError",
"(",
"'\\'jls\\' command not found'",
")",
"jails",
"=",
"__salt__",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_rcscript | Return full path to service rc script
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs | salt/modules/freebsdservice.py | def _get_rcscript(name, jail=None):
'''
Return full path to service rc script
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
'''
cmd = '{0} -r'.format(_cmd(jail))
prf = _get_jail_path(jail) if jail else ''
for line in __salt__['... | def _get_rcscript(name, jail=None):
'''
Return full path to service rc script
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
'''
cmd = '{0} -r'.format(_cmd(jail))
prf = _get_jail_path(jail) if jail else ''
for line in __salt__['... | [
"Return",
"full",
"path",
"to",
"service",
"rc",
"script"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L86-L99 | [
"def",
"_get_rcscript",
"(",
"name",
",",
"jail",
"=",
"None",
")",
":",
"cmd",
"=",
"'{0} -r'",
".",
"format",
"(",
"_cmd",
"(",
"jail",
")",
")",
"prf",
"=",
"_get_jail_path",
"(",
"jail",
")",
"if",
"jail",
"else",
"''",
"for",
"line",
"in",
"__... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_rcvar | Return rcvar
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs | salt/modules/freebsdservice.py | def _get_rcvar(name, jail=None):
'''
Return rcvar
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
'''
if not available(name, jail):
log.error('Service %s not found', name)
return False
cmd = '{0} {1} rcvar'.format(_c... | def _get_rcvar(name, jail=None):
'''
Return rcvar
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
'''
if not available(name, jail):
log.error('Service %s not found', name)
return False
cmd = '{0} {1} rcvar'.format(_c... | [
"Return",
"rcvar"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L102-L122 | [
"def",
"_get_rcvar",
"(",
"name",
",",
"jail",
"=",
"None",
")",
":",
"if",
"not",
"available",
"(",
"name",
",",
"jail",
")",
":",
"log",
".",
"error",
"(",
"'Service %s not found'",
",",
"name",
")",
"return",
"False",
"cmd",
"=",
"'{0} {1} rcvar'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_enabled | Return what services are set to run on boot
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
CLI Example:
.. code-block:: bash
salt '*' service.get_enabled | salt/modules/freebsdservice.py | def get_enabled(jail=None):
'''
Return what services are set to run on boot
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
CLI Example:
.. code-block:: bash
salt '*' service.get_enabled
'''
ret = []
service = _cmd... | def get_enabled(jail=None):
'''
Return what services are set to run on boot
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
CLI Example:
.. code-block:: bash
salt '*' service.get_enabled
'''
ret = []
service = _cmd... | [
"Return",
"what",
"services",
"are",
"set",
"to",
"run",
"on",
"boot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L125-L154 | [
"def",
"get_enabled",
"(",
"jail",
"=",
"None",
")",
":",
"ret",
"=",
"[",
"]",
"service",
"=",
"_cmd",
"(",
"jail",
")",
"prf",
"=",
"_get_jail_path",
"(",
"jail",
")",
"if",
"jail",
"else",
"''",
"for",
"svc",
"in",
"__salt__",
"[",
"'cmd.run'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_disabled | Return what services are available but not enabled to start at boot
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
CLI Example:
.. code-block:: bash
salt '*' service.get_disabled | salt/modules/freebsdservice.py | def get_disabled(jail=None):
'''
Return what services are available but not enabled to start at boot
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
CLI Example:
.. code-block:: bash
salt '*' service.get_disabled
'''
e... | def get_disabled(jail=None):
'''
Return what services are available but not enabled to start at boot
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
CLI Example:
.. code-block:: bash
salt '*' service.get_disabled
'''
e... | [
"Return",
"what",
"services",
"are",
"available",
"but",
"not",
"enabled",
"to",
"start",
"at",
"boot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L157-L173 | [
"def",
"get_disabled",
"(",
"jail",
"=",
"None",
")",
":",
"en_",
"=",
"get_enabled",
"(",
"jail",
")",
"all_",
"=",
"get_all",
"(",
"jail",
")",
"return",
"sorted",
"(",
"set",
"(",
"all_",
")",
"-",
"set",
"(",
"en_",
")",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _switch | Switch on/off service start at boot.
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) and chroot keyword argument
in kwargs. chroot should be used when jail's /etc is mounted read-only and
should point to a root directory where jail's /etc is mounted read-write. | salt/modules/freebsdservice.py | def _switch(name, # pylint: disable=C0103
on, # pylint: disable=C0103
**kwargs):
'''
Switch on/off service start at boot.
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) and chroot keyword argument
in kwarg... | def _switch(name, # pylint: disable=C0103
on, # pylint: disable=C0103
**kwargs):
'''
Switch on/off service start at boot.
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) and chroot keyword argument
in kwarg... | [
"Switch",
"on",
"/",
"off",
"service",
"start",
"at",
"boot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L176-L245 | [
"def",
"_switch",
"(",
"name",
",",
"# pylint: disable=C0103",
"on",
",",
"# pylint: disable=C0103",
"*",
"*",
"kwargs",
")",
":",
"jail",
"=",
"kwargs",
".",
"get",
"(",
"'jail'",
",",
"''",
")",
"chroot",
"=",
"kwargs",
".",
"get",
"(",
"'chroot'",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | enabled | Return True if the named service is enabled, false otherwise
name
Service name
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
CLI Example:
.. code-block:: bash
salt '*' service.enabled <service name> | salt/modules/freebsdservice.py | def enabled(name, **kwargs):
'''
Return True if the named service is enabled, false otherwise
name
Service name
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
CLI Example:
.. code-block:: bash
salt '*' service.en... | def enabled(name, **kwargs):
'''
Return True if the named service is enabled, false otherwise
name
Service name
.. versionchanged:: 2016.3.4
Support for jail (representing jid or jail name) keyword argument in kwargs
CLI Example:
.. code-block:: bash
salt '*' service.en... | [
"Return",
"True",
"if",
"the",
"named",
"service",
"is",
"enabled",
"false",
"otherwise"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L302-L333 | [
"def",
"enabled",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"jail",
"=",
"kwargs",
".",
"get",
"(",
"'jail'",
",",
"''",
")",
"if",
"not",
"available",
"(",
"name",
",",
"jail",
")",
":",
"log",
".",
"error",
"(",
"'Service %s not found'",
",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_all | Return a list of all available services
.. versionchanged:: 2016.3.4
jail: optional jid or jail name
CLI Example:
.. code-block:: bash
salt '*' service.get_all | salt/modules/freebsdservice.py | def get_all(jail=None):
'''
Return a list of all available services
.. versionchanged:: 2016.3.4
jail: optional jid or jail name
CLI Example:
.. code-block:: bash
salt '*' service.get_all
'''
ret = []
service = _cmd(jail)
for srv in __salt__['cmd.run']('{0} -l'.forma... | def get_all(jail=None):
'''
Return a list of all available services
.. versionchanged:: 2016.3.4
jail: optional jid or jail name
CLI Example:
.. code-block:: bash
salt '*' service.get_all
'''
ret = []
service = _cmd(jail)
for srv in __salt__['cmd.run']('{0} -l'.forma... | [
"Return",
"a",
"list",
"of",
"all",
"available",
"services"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L385-L404 | [
"def",
"get_all",
"(",
"jail",
"=",
"None",
")",
":",
"ret",
"=",
"[",
"]",
"service",
"=",
"_cmd",
"(",
"jail",
")",
"for",
"srv",
"in",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'{0} -l'",
".",
"format",
"(",
"service",
")",
")",
".",
"splitlines"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | start | Start the specified service
.. versionchanged:: 2016.3.4
jail: optional jid or jail name
CLI Example:
.. code-block:: bash
salt '*' service.start <service name> | salt/modules/freebsdservice.py | def start(name, jail=None):
'''
Start the specified service
.. versionchanged:: 2016.3.4
jail: optional jid or jail name
CLI Example:
.. code-block:: bash
salt '*' service.start <service name>
'''
cmd = '{0} {1} onestart'.format(_cmd(jail), name)
return not __salt__['cmd... | def start(name, jail=None):
'''
Start the specified service
.. versionchanged:: 2016.3.4
jail: optional jid or jail name
CLI Example:
.. code-block:: bash
salt '*' service.start <service name>
'''
cmd = '{0} {1} onestart'.format(_cmd(jail), name)
return not __salt__['cmd... | [
"Start",
"the",
"specified",
"service"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdservice.py#L407-L422 | [
"def",
"start",
"(",
"name",
",",
"jail",
"=",
"None",
")",
":",
"cmd",
"=",
"'{0} {1} onestart'",
".",
"format",
"(",
"_cmd",
"(",
"jail",
")",
",",
"name",
")",
"return",
"not",
"__salt__",
"[",
"'cmd.retcode'",
"]",
"(",
"cmd",
",",
"python_shell",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _python_installed | Check to see if given python is installed. | salt/states/pyenv.py | def _python_installed(ret, python, user=None):
'''
Check to see if given python is installed.
'''
default = __salt__['pyenv.default'](runas=user)
for version in __salt__['pyenv.versions'](user):
if version == python:
ret['result'] = True
ret['comment'] = 'Requested py... | def _python_installed(ret, python, user=None):
'''
Check to see if given python is installed.
'''
default = __salt__['pyenv.default'](runas=user)
for version in __salt__['pyenv.versions'](user):
if version == python:
ret['result'] = True
ret['comment'] = 'Requested py... | [
"Check",
"to",
"see",
"if",
"given",
"python",
"is",
"installed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L67-L79 | [
"def",
"_python_installed",
"(",
"ret",
",",
"python",
",",
"user",
"=",
"None",
")",
":",
"default",
"=",
"__salt__",
"[",
"'pyenv.default'",
"]",
"(",
"runas",
"=",
"user",
")",
"for",
"version",
"in",
"__salt__",
"[",
"'pyenv.versions'",
"]",
"(",
"us... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_and_install_python | Verify that python is installed, install if unavailable | salt/states/pyenv.py | def _check_and_install_python(ret, python, default=False, user=None):
'''
Verify that python is installed, install if unavailable
'''
ret = _python_installed(ret, python, user=user)
if not ret['result']:
if __salt__['pyenv.install_python'](python, runas=user):
ret['result'] = Tru... | def _check_and_install_python(ret, python, default=False, user=None):
'''
Verify that python is installed, install if unavailable
'''
ret = _python_installed(ret, python, user=user)
if not ret['result']:
if __salt__['pyenv.install_python'](python, runas=user):
ret['result'] = Tru... | [
"Verify",
"that",
"python",
"is",
"installed",
"install",
"if",
"unavailable"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L82-L101 | [
"def",
"_check_and_install_python",
"(",
"ret",
",",
"python",
",",
"default",
"=",
"False",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"_python_installed",
"(",
"ret",
",",
"python",
",",
"user",
"=",
"user",
")",
"if",
"not",
"ret",
"[",
"'resul... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | installed | Verify that the specified python is installed with pyenv. pyenv is
installed if necessary.
name
The version of python to install
default : False
Whether to make this python the default.
user: None
The user to run pyenv as.
.. versionadded:: 0.17.0
.. versionadded... | salt/states/pyenv.py | def installed(name, default=False, user=None):
'''
Verify that the specified python is installed with pyenv. pyenv is
installed if necessary.
name
The version of python to install
default : False
Whether to make this python the default.
user: None
The user to run pyenv... | def installed(name, default=False, user=None):
'''
Verify that the specified python is installed with pyenv. pyenv is
installed if necessary.
name
The version of python to install
default : False
Whether to make this python the default.
user: None
The user to run pyenv... | [
"Verify",
"that",
"the",
"specified",
"python",
"is",
"installed",
"with",
"pyenv",
".",
"pyenv",
"is",
"installed",
"if",
"necessary",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L104-L139 | [
"def",
"installed",
"(",
"name",
",",
"default",
"=",
"False",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"nam... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_and_uninstall_python | Verify that python is uninstalled | salt/states/pyenv.py | def _check_and_uninstall_python(ret, python, user=None):
'''
Verify that python is uninstalled
'''
ret = _python_installed(ret, python, user=user)
if ret['result']:
if ret['default']:
__salt__['pyenv.default']('system', runas=user)
if __salt__['pyenv.uninstall_python'](p... | def _check_and_uninstall_python(ret, python, user=None):
'''
Verify that python is uninstalled
'''
ret = _python_installed(ret, python, user=user)
if ret['result']:
if ret['default']:
__salt__['pyenv.default']('system', runas=user)
if __salt__['pyenv.uninstall_python'](p... | [
"Verify",
"that",
"python",
"is",
"uninstalled"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L142-L164 | [
"def",
"_check_and_uninstall_python",
"(",
"ret",
",",
"python",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"_python_installed",
"(",
"ret",
",",
"python",
",",
"user",
"=",
"user",
")",
"if",
"ret",
"[",
"'result'",
"]",
":",
"if",
"ret",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Verify that the specified python is not installed with pyenv. pyenv
is installed if necessary.
name
The version of python to uninstall
user: None
The user to run pyenv as.
.. versionadded:: 0.17.0
.. versionadded:: 0.16.0 | salt/states/pyenv.py | def absent(name, user=None):
'''
Verify that the specified python is not installed with pyenv. pyenv
is installed if necessary.
name
The version of python to uninstall
user: None
The user to run pyenv as.
.. versionadded:: 0.17.0
.. versionadded:: 0.16.0
'''
r... | def absent(name, user=None):
'''
Verify that the specified python is not installed with pyenv. pyenv
is installed if necessary.
name
The version of python to uninstall
user: None
The user to run pyenv as.
.. versionadded:: 0.17.0
.. versionadded:: 0.16.0
'''
r... | [
"Verify",
"that",
"the",
"specified",
"python",
"is",
"not",
"installed",
"with",
"pyenv",
".",
"pyenv",
"is",
"installed",
"if",
"necessary",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L167-L197 | [
"def",
"absent",
"(",
"name",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"name",
".",
"startswith",
"(",
"'pyt... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install_pyenv | Install pyenv if not installed. Allows you to require pyenv be installed
prior to installing the plugins. Useful if you want to install pyenv
plugins via the git or file modules and need them installed before
installing any rubies.
Use the pyenv.root configuration option to set the path for pyenv if yo... | salt/states/pyenv.py | def install_pyenv(name, user=None):
'''
Install pyenv if not installed. Allows you to require pyenv be installed
prior to installing the plugins. Useful if you want to install pyenv
plugins via the git or file modules and need them installed before
installing any rubies.
Use the pyenv.root conf... | def install_pyenv(name, user=None):
'''
Install pyenv if not installed. Allows you to require pyenv be installed
prior to installing the plugins. Useful if you want to install pyenv
plugins via the git or file modules and need them installed before
installing any rubies.
Use the pyenv.root conf... | [
"Install",
"pyenv",
"if",
"not",
"installed",
".",
"Allows",
"you",
"to",
"require",
"pyenv",
"be",
"installed",
"prior",
"to",
"installing",
"the",
"plugins",
".",
"Useful",
"if",
"you",
"want",
"to",
"install",
"pyenv",
"plugins",
"via",
"the",
"git",
"o... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pyenv.py#L200-L219 | [
"def",
"install_pyenv",
"(",
"name",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"__opts__",
"[",
"'test'",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | send_msg | Send a message via SMTP
.. code-block:: yaml
server-warning-message:
smtp.send_msg:
- name: 'This is a server warning message'
- profile: my-smtp-account
- subject: 'Message from Salt'
- recipient: admin@example.com
- sender: admin@exam... | salt/states/smtp.py | def send_msg(name,
recipient,
subject,
sender=None,
profile=None,
use_ssl='True',
attachments=None):
'''
Send a message via SMTP
.. code-block:: yaml
server-warning-message:
smtp.send_msg:
- name: '... | def send_msg(name,
recipient,
subject,
sender=None,
profile=None,
use_ssl='True',
attachments=None):
'''
Send a message via SMTP
.. code-block:: yaml
server-warning-message:
smtp.send_msg:
- name: '... | [
"Send",
"a",
"message",
"via",
"SMTP"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/smtp.py#L30-L94 | [
"def",
"send_msg",
"(",
"name",
",",
"recipient",
",",
"subject",
",",
"sender",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"use_ssl",
"=",
"'True'",
",",
"attachments",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'change... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_selections | Answers to debconf questions for all packages in the following format::
{'package': [['question', 'type', 'value'], ...]}
CLI Example:
.. code-block:: bash
salt '*' debconf.get_selections | salt/modules/debconfmod.py | def get_selections(fetchempty=True):
'''
Answers to debconf questions for all packages in the following format::
{'package': [['question', 'type', 'value'], ...]}
CLI Example:
.. code-block:: bash
salt '*' debconf.get_selections
'''
selections = {}
cmd = 'debconf-get-sele... | def get_selections(fetchempty=True):
'''
Answers to debconf questions for all packages in the following format::
{'package': [['question', 'type', 'value'], ...]}
CLI Example:
.. code-block:: bash
salt '*' debconf.get_selections
'''
selections = {}
cmd = 'debconf-get-sele... | [
"Answers",
"to",
"debconf",
"questions",
"for",
"all",
"packages",
"in",
"the",
"following",
"format",
"::"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debconfmod.py#L57-L83 | [
"def",
"get_selections",
"(",
"fetchempty",
"=",
"True",
")",
":",
"selections",
"=",
"{",
"}",
"cmd",
"=",
"'debconf-get-selections'",
"out",
"=",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
"cmd",
")",
"lines",
"=",
"_unpack_lines",
"(",
"out",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_ | Set answers to debconf questions for a package.
CLI Example:
.. code-block:: bash
salt '*' debconf.set <package> <question> <type> <value> [<value> ...] | salt/modules/debconfmod.py | def set_(package, question, type, value, *extra):
'''
Set answers to debconf questions for a package.
CLI Example:
.. code-block:: bash
salt '*' debconf.set <package> <question> <type> <value> [<value> ...]
'''
if extra:
value = ' '.join((value,) + tuple(extra))
fd_, fna... | def set_(package, question, type, value, *extra):
'''
Set answers to debconf questions for a package.
CLI Example:
.. code-block:: bash
salt '*' debconf.set <package> <question> <type> <value> [<value> ...]
'''
if extra:
value = ' '.join((value,) + tuple(extra))
fd_, fna... | [
"Set",
"answers",
"to",
"debconf",
"questions",
"for",
"a",
"package",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debconfmod.py#L115-L139 | [
"def",
"set_",
"(",
"package",
",",
"question",
",",
"type",
",",
"value",
",",
"*",
"extra",
")",
":",
"if",
"extra",
":",
"value",
"=",
"' '",
".",
"join",
"(",
"(",
"value",
",",
")",
"+",
"tuple",
"(",
"extra",
")",
")",
"fd_",
",",
"fname"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_template | Set answers to debconf questions from a template.
path
location of the file containing the package selections
template
template format
context
variables to add to the template environment
default
default values for the template environment
CLI Example:
.. co... | salt/modules/debconfmod.py | def set_template(path, template, context, defaults, saltenv='base', **kwargs):
'''
Set answers to debconf questions from a template.
path
location of the file containing the package selections
template
template format
context
variables to add to the template environment
... | def set_template(path, template, context, defaults, saltenv='base', **kwargs):
'''
Set answers to debconf questions from a template.
path
location of the file containing the package selections
template
template format
context
variables to add to the template environment
... | [
"Set",
"answers",
"to",
"debconf",
"questions",
"from",
"a",
"template",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debconfmod.py#L142-L175 | [
"def",
"set_template",
"(",
"path",
",",
"template",
",",
"context",
",",
"defaults",
",",
"saltenv",
"=",
"'base'",
",",
"*",
"*",
"kwargs",
")",
":",
"path",
"=",
"__salt__",
"[",
"'cp.get_template'",
"]",
"(",
"path",
"=",
"path",
",",
"dest",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_file | Set answers to debconf questions from a file.
CLI Example:
.. code-block:: bash
salt '*' debconf.set_file salt://pathto/pkg.selections | salt/modules/debconfmod.py | def set_file(path, saltenv='base', **kwargs):
'''
Set answers to debconf questions from a file.
CLI Example:
.. code-block:: bash
salt '*' debconf.set_file salt://pathto/pkg.selections
'''
if '__env__' in kwargs:
# "env" is not supported; Use "saltenv".
kwargs.pop('__e... | def set_file(path, saltenv='base', **kwargs):
'''
Set answers to debconf questions from a file.
CLI Example:
.. code-block:: bash
salt '*' debconf.set_file salt://pathto/pkg.selections
'''
if '__env__' in kwargs:
# "env" is not supported; Use "saltenv".
kwargs.pop('__e... | [
"Set",
"answers",
"to",
"debconf",
"questions",
"from",
"a",
"file",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debconfmod.py#L178-L197 | [
"def",
"set_file",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'__env__'",
"in",
"kwargs",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"kwargs",
".",
"pop",
"(",
"'__env__'",
")",
"path",
"=",
"__salt__",
"[... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | prep_jid | Call both with prep_jid on all returners in multi_returner
TODO: finish this, what do do when you get different jids from 2 returners...
since our jids are time based, this make this problem hard, because they
aren't unique, meaning that we have to make sure that no one else got the jid
and if they did... | salt/returners/multi_returner.py | def prep_jid(nocache=False, passed_jid=None):
'''
Call both with prep_jid on all returners in multi_returner
TODO: finish this, what do do when you get different jids from 2 returners...
since our jids are time based, this make this problem hard, because they
aren't unique, meaning that we have to ... | def prep_jid(nocache=False, passed_jid=None):
'''
Call both with prep_jid on all returners in multi_returner
TODO: finish this, what do do when you get different jids from 2 returners...
since our jids are time based, this make this problem hard, because they
aren't unique, meaning that we have to ... | [
"Call",
"both",
"with",
"prep_jid",
"on",
"all",
"returners",
"in",
"multi_returner"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L34-L53 | [
"def",
"prep_jid",
"(",
"nocache",
"=",
"False",
",",
"passed_jid",
"=",
"None",
")",
":",
"jid",
"=",
"passed_jid",
"for",
"returner_",
"in",
"__opts__",
"[",
"CONFIG_KEY",
"]",
":",
"if",
"jid",
"is",
"None",
":",
"jid",
"=",
"_mminion",
"(",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | returner | Write return to all returners in multi_returner | salt/returners/multi_returner.py | def returner(load):
'''
Write return to all returners in multi_returner
'''
for returner_ in __opts__[CONFIG_KEY]:
_mminion().returners['{0}.returner'.format(returner_)](load) | def returner(load):
'''
Write return to all returners in multi_returner
'''
for returner_ in __opts__[CONFIG_KEY]:
_mminion().returners['{0}.returner'.format(returner_)](load) | [
"Write",
"return",
"to",
"all",
"returners",
"in",
"multi_returner"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L56-L61 | [
"def",
"returner",
"(",
"load",
")",
":",
"for",
"returner_",
"in",
"__opts__",
"[",
"CONFIG_KEY",
"]",
":",
"_mminion",
"(",
")",
".",
"returners",
"[",
"'{0}.returner'",
".",
"format",
"(",
"returner_",
")",
"]",
"(",
"load",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | save_load | Write load to all returners in multi_returner | salt/returners/multi_returner.py | def save_load(jid, clear_load, minions=None):
'''
Write load to all returners in multi_returner
'''
for returner_ in __opts__[CONFIG_KEY]:
_mminion().returners['{0}.save_load'.format(returner_)](jid, clear_load) | def save_load(jid, clear_load, minions=None):
'''
Write load to all returners in multi_returner
'''
for returner_ in __opts__[CONFIG_KEY]:
_mminion().returners['{0}.save_load'.format(returner_)](jid, clear_load) | [
"Write",
"load",
"to",
"all",
"returners",
"in",
"multi_returner"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L64-L69 | [
"def",
"save_load",
"(",
"jid",
",",
"clear_load",
",",
"minions",
"=",
"None",
")",
":",
"for",
"returner_",
"in",
"__opts__",
"[",
"CONFIG_KEY",
"]",
":",
"_mminion",
"(",
")",
".",
"returners",
"[",
"'{0}.save_load'",
".",
"format",
"(",
"returner_",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_load | Merge the load data from all returners | salt/returners/multi_returner.py | def get_load(jid):
'''
Merge the load data from all returners
'''
ret = {}
for returner_ in __opts__[CONFIG_KEY]:
ret.update(_mminion().returners['{0}.get_load'.format(returner_)](jid))
return ret | def get_load(jid):
'''
Merge the load data from all returners
'''
ret = {}
for returner_ in __opts__[CONFIG_KEY]:
ret.update(_mminion().returners['{0}.get_load'.format(returner_)](jid))
return ret | [
"Merge",
"the",
"load",
"data",
"from",
"all",
"returners"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L79-L87 | [
"def",
"get_load",
"(",
"jid",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"returner_",
"in",
"__opts__",
"[",
"CONFIG_KEY",
"]",
":",
"ret",
".",
"update",
"(",
"_mminion",
"(",
")",
".",
"returners",
"[",
"'{0}.get_load'",
".",
"format",
"(",
"returner_",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_jids | Return all job data from all returners | salt/returners/multi_returner.py | def get_jids():
'''
Return all job data from all returners
'''
ret = {}
for returner_ in __opts__[CONFIG_KEY]:
ret.update(_mminion().returners['{0}.get_jids'.format(returner_)]())
return ret | def get_jids():
'''
Return all job data from all returners
'''
ret = {}
for returner_ in __opts__[CONFIG_KEY]:
ret.update(_mminion().returners['{0}.get_jids'.format(returner_)]())
return ret | [
"Return",
"all",
"job",
"data",
"from",
"all",
"returners"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L101-L109 | [
"def",
"get_jids",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"returner_",
"in",
"__opts__",
"[",
"CONFIG_KEY",
"]",
":",
"ret",
".",
"update",
"(",
"_mminion",
"(",
")",
".",
"returners",
"[",
"'{0}.get_jids'",
".",
"format",
"(",
"returner_",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | clean_old_jobs | Clean out the old jobs from all returners (if you have it) | salt/returners/multi_returner.py | def clean_old_jobs():
'''
Clean out the old jobs from all returners (if you have it)
'''
for returner_ in __opts__[CONFIG_KEY]:
fstr = '{0}.clean_old_jobs'.format(returner_)
if fstr in _mminion().returners:
_mminion().returners[fstr]() | def clean_old_jobs():
'''
Clean out the old jobs from all returners (if you have it)
'''
for returner_ in __opts__[CONFIG_KEY]:
fstr = '{0}.clean_old_jobs'.format(returner_)
if fstr in _mminion().returners:
_mminion().returners[fstr]() | [
"Clean",
"out",
"the",
"old",
"jobs",
"from",
"all",
"returners",
"(",
"if",
"you",
"have",
"it",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/multi_returner.py#L112-L119 | [
"def",
"clean_old_jobs",
"(",
")",
":",
"for",
"returner_",
"in",
"__opts__",
"[",
"CONFIG_KEY",
"]",
":",
"fstr",
"=",
"'{0}.clean_old_jobs'",
".",
"format",
"(",
"returner_",
")",
"if",
"fstr",
"in",
"_mminion",
"(",
")",
".",
"returners",
":",
"_mminion... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure domain exists and is up-to-date
name
Name of the domain
enabled
Boolean to control if domain is enabled
description
An arbitrary description of the domain | salt/states/keystone_domain.py | def present(name, auth=None, **kwargs):
'''
Ensure domain exists and is up-to-date
name
Name of the domain
enabled
Boolean to control if domain is enabled
description
An arbitrary description of the domain
'''
ret = {'name': name,
'changes': {},
... | def present(name, auth=None, **kwargs):
'''
Ensure domain exists and is up-to-date
name
Name of the domain
enabled
Boolean to control if domain is enabled
description
An arbitrary description of the domain
'''
ret = {'name': name,
'changes': {},
... | [
"Ensure",
"domain",
"exists",
"and",
"is",
"up",
"-",
"to",
"-",
"date"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_domain.py#L41-L91 | [
"def",
"present",
"(",
"name",
",",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"kwargs",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure domain does not exist
name
Name of the domain | salt/states/keystone_domain.py | def absent(name, auth=None):
'''
Ensure domain does not exist
name
Name of the domain
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
__salt__['keystoneng.setup_clouds'](auth)
domain = __salt__['keystoneng.domain_get'](name=n... | def absent(name, auth=None):
'''
Ensure domain does not exist
name
Name of the domain
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
__salt__['keystoneng.setup_clouds'](auth)
domain = __salt__['keystoneng.domain_get'](name=n... | [
"Ensure",
"domain",
"does",
"not",
"exist"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_domain.py#L94-L121 | [
"def",
"absent",
"(",
"name",
",",
"auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"__salt__",
"[",
"'keystoneng.setup_clouds'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.