Code stringlengths 103 85.9k | Summary listlengths 0 94 |
|---|---|
Please provide a description of the function:def get_system_time():
'''
Get the system time.
Returns:
str: Returns the system time in HH:MM:SS AM/PM format.
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_system_time
'''
now = win32api.GetLocalTime()
mer... | [] |
Please provide a description of the function:def set_system_date_time(years=None,
months=None,
days=None,
hours=None,
minutes=None,
seconds=None):
'''
Set the system date and time. Each a... | [] |
Please provide a description of the function:def set_system_date(newdate):
'''
Set the Windows system date. Use <mm-dd-yy> format for the date.
Args:
newdate (str):
The date to set. Can be any of the following formats
- YYYY-MM-DD
- MM-DD-YYYY
- MM-D... | [] |
Please provide a description of the function:def get_pending_component_servicing():
'''
Determine whether there are pending Component Based Servicing tasks that
require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Component Based Servicing tasks,
... | [] |
Please provide a description of the function:def get_pending_domain_join():
'''
Determine whether there is a pending domain join action that requires a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there is a pending domain join action, otherwise
``False``
CLI... | [] |
Please provide a description of the function:def get_pending_file_rename():
'''
Determine whether there are pending file rename operations that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending file rename operations, otherwise
``False``
... | [] |
Please provide a description of the function:def get_pending_servermanager():
'''
Determine whether there are pending Server Manager tasks that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Server Manager tasks, otherwise
``False``
... | [] |
Please provide a description of the function:def get_pending_update():
'''
Determine whether there are pending updates that require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending updates, otherwise ``False``
CLI Example:
.. code-block:: bash
... | [] |
Please provide a description of the function:def set_reboot_required_witnessed():
r'''
This function is used to remember that an event indicating that a reboot is
required was witnessed. This function relies on the salt-minion's ability to
create the following volatile registry key in the *HKLM* hive:
... | [] |
Please provide a description of the function:def get_pending_reboot():
'''
Determine whether there is a reboot pending.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if the system is pending reboot, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.... | [] |
Please provide a description of the function:def present(name,
if_not_exists=None,
schema=None,
ext_version=None,
from_version=None,
user=None,
maintenance_db=None,
db_user=None,
db_password=None,
db_host=None,
... | [] |
Please provide a description of the function:def absent(name,
if_exists=None,
restrict=None,
cascade=None,
user=None,
maintenance_db=None,
db_user=None,
db_password=None,
db_host=None,
db_port=None):
'''
Ensure th... | [] |
Please provide a description of the function:def _get_file_auth_config():
'''
Setup defaults and check configuration variables for auth backends
'''
config = {
'filetype': 'text',
'hashtype': 'plaintext',
'field_separator': ':',
'username_field': 1,
'password_fie... | [] |
Please provide a description of the function:def _text(username, password, **kwargs):
'''
The text file function can authenticate plaintext and digest methods
that are available in the :py:func:`hashutil.digest <salt.modules.hashutil.digest>`
function.
'''
filename = kwargs['filename']
hash... | [] |
Please provide a description of the function:def _htdigest(username, password, **kwargs):
'''
Provide authentication via Apache-style htdigest files
'''
realm = kwargs.get('realm', None)
if not realm:
log.error('salt.auth.file: A ^realm must be defined in '
'external_auth:... | [] |
Please provide a description of the function:def _htfile(username, password, **kwargs):
'''
Gate function for _htpasswd and _htdigest authentication backends
'''
filetype = kwargs.get('filetype', 'htpasswd').lower()
try:
import passlib
kwargs['passlib_version'] = passlib.__version_... | [] |
Please provide a description of the function:def auth(username, password):
'''
File based authentication
^filename
The path to the file to use for authentication.
^filetype
The type of file: ``text``, ``htpasswd``, ``htdigest``.
Default: ``text``
^realm
The realm ... | [] |
Please provide a description of the function:def present(name, parent=None, vlan=None):
'''
Ensures that the named bridge exists, eventually creates it.
Args:
name: The name of the bridge.
parent: The name of the parent bridge (if the bridge shall be created
as a fake bridge). I... | [] |
Please provide a description of the function:def absent(name):
'''
Ensures that the named bridge does not exist, eventually deletes it.
Args:
name: The name of the bridge.
'''
ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}
# Comment and change messages
commen... | [] |
Please provide a description of the function:def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
command):
'''
Execute a command and read the output as YAMLEX
'''
try:
command = command.replace('%s', minion_id)
return deserial... | [] |
Please provide a description of the function:def deployment_absent(name, namespace='default', **kwargs):
'''
Ensures that the named deployment is absent from the given namespace.
name
The name of the deployment
namespace
The name of the namespace
'''
ret = {'name': name,
... | [] |
Please provide a description of the function:def deployment_present(
name,
namespace='default',
metadata=None,
spec=None,
source='',
template='',
**kwargs):
'''
Ensures that the named deployment is present inside of the specified
namespace with the giv... | [] |
Please provide a description of the function:def service_present(
name,
namespace='default',
metadata=None,
spec=None,
source='',
template='',
**kwargs):
'''
Ensures that the named service is present inside of the specified namespace
with the given met... | [] |
Please provide a description of the function:def service_absent(name, namespace='default', **kwargs):
'''
Ensures that the named service is absent from the given namespace.
name
The name of the service
namespace
The name of the namespace
'''
ret = {'name': name,
'ch... | [] |
Please provide a description of the function:def namespace_absent(name, **kwargs):
'''
Ensures that the named namespace is absent.
name
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
namespace = __salt... | [] |
Please provide a description of the function:def namespace_present(name, **kwargs):
'''
Ensures that the named namespace is present.
name
The name of the namespace.
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
namespace = __s... | [] |
Please provide a description of the function:def secret_absent(name, namespace='default', **kwargs):
'''
Ensures that the named secret is absent from the given namespace.
name
The name of the secret
namespace
The name of the namespace
'''
ret = {'name': name,
'chang... | [] |
Please provide a description of the function:def secret_present(
name,
namespace='default',
data=None,
source=None,
template=None,
**kwargs):
'''
Ensures that the named secret is present inside of the specified namespace
with the given data.
If the secret ... | [] |
Please provide a description of the function:def configmap_absent(name, namespace='default', **kwargs):
'''
Ensures that the named configmap is absent from the given namespace.
name
The name of the configmap
namespace
The namespace holding the configmap. The 'default' one is going to b... | [] |
Please provide a description of the function:def configmap_present(
name,
namespace='default',
data=None,
source=None,
template=None,
**kwargs):
'''
Ensures that the named configmap is present inside of the specified namespace
with the given data.
If the c... | [] |
Please provide a description of the function:def pod_absent(name, namespace='default', **kwargs):
'''
Ensures that the named pod is absent from the given namespace.
name
The name of the pod
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
... | [] |
Please provide a description of the function:def pod_present(
name,
namespace='default',
metadata=None,
spec=None,
source='',
template='',
**kwargs):
'''
Ensures that the named pod is present inside of the specified
namespace with the given metadata an... | [] |
Please provide a description of the function:def node_label_absent(name, node, **kwargs):
'''
Ensures that the named label is absent from the node.
name
The name of the label
node
The name of the node
'''
ret = {'name': name,
'changes': {},
'result': Fals... | [] |
Please provide a description of the function:def node_label_folder_absent(name, node, **kwargs):
'''
Ensures the label folder doesn't exist on the specified node.
name
The name of label folder
node
The name of the node
'''
ret = {'name': name,
'changes': {},
... | [] |
Please provide a description of the function:def node_label_present(
name,
node,
value,
**kwargs):
'''
Ensures that the named label is set on the named node
with the given value.
If the label exists it will be replaced.
name
The name of the label.
value
... | [] |
Please provide a description of the function:def init(opts):
'''
This function gets called when the proxy starts up. For
login the protocol and port are cached.
'''
log.debug('Initting esxvm proxy module in process %s', os.getpid())
log.debug('Validating esxvm proxy input')
proxy_conf = merg... | [] |
Please provide a description of the function:def find_credentials():
'''
Cycle through all the possible credentials and return the first one that
works.
'''
# if the username and password were already found don't go through the
# connection process again
if 'username' in DETAILS and 'passwo... | [] |
Please provide a description of the function:def multipath_flush(device):
'''
Device-Mapper Multipath flush
CLI Example:
.. code-block:: bash
salt '*' devmap.multipath_flush mpath1
'''
if not os.path.exists(device):
return '{0} does not exist'.format(device)
cmd = 'multip... | [] |
Please provide a description of the function:def set_file(name, source, template=None, context=None, defaults=None, **kwargs):
'''
Set debconf selections from a file or a template
.. code-block:: yaml
<state_id>:
debconf.set_file:
- source: salt://pathto/pkg.selections
... | [] |
Please provide a description of the function:def set(name, data, **kwargs):
'''
Set debconf selections
.. code-block:: yaml
<state_id>:
debconf.set:
- name: <name>
- data:
<question>: {'type': <type>, 'value': <value>}
<question>: {... | [] |
Please provide a description of the function:def start(docker_url='unix://var/run/docker.sock',
timeout=CLIENT_TIMEOUT,
tag='salt/engines/docker_events',
filters=None):
'''
Scan for Docker events and fire events
Example Config
.. code-block:: yaml
engines:
... | [] |
Please provide a description of the function:def _get_config(**api_opts):
'''
Return configuration
user passed api_opts override salt config.get vars
'''
config = {
'api_sslverify': True,
'api_url': 'https://INFOBLOX/wapi/v1.2.1',
'api_user': '',
'api_key': '',
}
... | [] |
Please provide a description of the function:def update_host(name, data, **api_opts):
'''
Update host record. This is a helper call to update_object.
Find a hosts ``_ref`` then call update_object with the record data.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_host name=... | [] |
Please provide a description of the function:def update_object(objref, data, **api_opts):
'''
Update raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_object objref=[ref_of_object] data={}
'''
if '__opts__' in globals() and ... | [] |
Please provide a description of the function:def delete_object(objref, **api_opts):
'''
Delete infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.delete_object objref=[ref_of_object]
'''
if '__opts__' in globals() and __opts__['test']:
... | [] |
Please provide a description of the function:def create_object(object_type, data, **api_opts):
'''
Create raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_object object_type=record:host data={}
'''
if '__opts__' in globals... | [] |
Please provide a description of the function:def get_object(objref, data=None, return_fields=None, max_results=None,
ensure_none_or_one_result=False, **api_opts):
'''
Get raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.get... | [] |
Please provide a description of the function:def create_cname(data, **api_opts):
'''
Create a cname record.
CLI Example:
.. code-block:: bash
salt-call infoblox.create_cname data={ \
"comment": "cname to example server", \
"name": "example.example.com", \
"... | [] |
Please provide a description of the function:def get_cname(name=None, canonical=None, return_fields=None, **api_opts):
'''
Get CNAME information.
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_cname name=example.example.com
salt-call infoblox.get_cname canonical=example-ha-... | [] |
Please provide a description of the function:def update_cname(name, data, **api_opts):
'''
Update CNAME. This is a helper call to update_object.
Find a CNAME ``_ref`` then call update_object with the record data.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_cname name=exam... | [] |
Please provide a description of the function:def delete_cname(name=None, canonical=None, **api_opts):
'''
Delete CNAME. This is a helper call to delete_object.
If record is not found, return True
CLI Examples:
.. code-block:: bash
salt-call infoblox.delete_cname name=example.example.com
... | [] |
Please provide a description of the function:def get_host(name=None, ipv4addr=None, mac=None, return_fields=None, **api_opts):
'''
Get host information
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_host hostname.domain.ca
salt-call infoblox.get_host ipv4addr=123.123.122.12... | [] |
Please provide a description of the function:def get_host_advanced(name=None, ipv4addr=None, mac=None, **api_opts):
'''
Get all host information
CLI Example:
.. code-block:: bash
salt-call infoblox.get_host_advanced hostname.domain.ca
'''
infoblox = _get_infoblox(**api_opts)
host ... | [] |
Please provide a description of the function:def get_host_domainname(name, domains=None, **api_opts):
'''
Get host domain name
If no domains are passed, the hostname is checked for a zone in infoblox,
if no zone split on first dot.
If domains are provided, the best match out of the list is returne... | [] |
Please provide a description of the function:def get_host_hostname(name, domains=None, **api_opts):
'''
Get hostname
If no domains are passed, the hostname is checked for a zone in infoblox,
if no zone split on first dot.
If domains are provided, the best match out of the list is truncated from
... | [] |
Please provide a description of the function:def get_host_mac(name=None, allow_array=False, **api_opts):
'''
Get mac address from host record.
Use `allow_array` to return possible multiple values.
CLI Example:
.. code-block:: bash
salt-call infoblox.get_host_mac host=localhost.domain.com... | [] |
Please provide a description of the function:def get_host_ipv4(name=None, mac=None, allow_array=False, **api_opts):
'''
Get ipv4 address from host record.
Use `allow_array` to return possible multiple values.
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_host_ipv4 host=localh... | [] |
Please provide a description of the function:def get_host_ipv4addr_info(ipv4addr=None, mac=None,
discovered_data=None,
return_fields=None, **api_opts):
'''
Get host ipv4addr information
CLI Examples:
.. code-block:: bash
... | [] |
Please provide a description of the function:def get_host_ipv6addr_info(ipv6addr=None, mac=None,
discovered_data=None,
return_fields=None, **api_opts):
'''
Get host ipv6addr information
CLI Example:
.. code-block:: bash
... | [] |
Please provide a description of the function:def get_network(ipv4addr=None, network=None, return_fields=None, **api_opts):
'''
Get list of all networks. This is helpful when looking up subnets to use
with func:nextavailableip
This call is offen slow and not cached!
some return_fields
comment,n... | [] |
Please provide a description of the function:def delete_host(name=None, mac=None, ipv4addr=None, **api_opts):
'''
Delete host
CLI Example:
.. code-block:: bash
salt-call infoblox.delete_host name=example.domain.com
salt-call infoblox.delete_host ipv4addr=123.123.122.12
salt-ca... | [] |
Please provide a description of the function:def get_ipv4_range(start_addr=None, end_addr=None, return_fields=None, **api_opts):
'''
Get ip range
CLI Example:
.. code-block:: bash
salt-call infoblox.get_ipv4_range start_addr=123.123.122.12
'''
infoblox = _get_infoblox(**api_opts)
... | [] |
Please provide a description of the function:def delete_ipv4_range(start_addr=None, end_addr=None, **api_opts):
'''
Delete ip range.
CLI Example:
.. code-block:: bash
salt-call infoblox.delete_ipv4_range start_addr=123.123.122.12
'''
r = get_ipv4_range(start_addr, end_addr, **api_opts... | [] |
Please provide a description of the function:def get_a(name=None, ipv4addr=None, allow_array=True, **api_opts):
'''
Get A record
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_a name=abc.example.com
salt-call infoblox.get_a ipv4addr=192.168.3.5
'''
data = {}
if ... | [] |
Please provide a description of the function:def delete_a(name=None, ipv4addr=None, allow_array=False, **api_opts):
'''
Delete A record
If the A record is used as a round robin you can set ``allow_array=True`` to
delete all records for the hostname.
CLI Examples:
.. code-block:: bash
... | [] |
Please provide a description of the function:def present(name=None, ipv4addr=None, data=None, ensure_data=True, **api_opts):
'''
Ensure infoblox A record.
When you wish to update a hostname ensure `name` is set to the hostname
of the current record. You can give a new name in the `data.name`.
Stat... | [] |
Please provide a description of the function:def absent(name=None, ipv4addr=None, **api_opts):
'''
Ensure infoblox A record is removed.
State example:
.. code-block:: yaml
infoblox_a.absent:
- name: example-ha-0.domain.com
infoblox_a.absent:
- name:
... | [] |
Please provide a description of the function:def _get_url():
'''
Get the kapacitor URL.
'''
protocol = __salt__['config.option']('kapacitor.protocol', 'http')
host = __salt__['config.option']('kapacitor.host', 'localhost')
port = __salt__['config.option']('kapacitor.port', 9092)
return '{0}... | [] |
Please provide a description of the function:def get_task(name):
'''
Get a dict of data on a task.
name
Name of the task to get information about.
CLI Example:
.. code-block:: bash
salt '*' kapacitor.get_task cpu
'''
url = _get_url()
if version() < '0.13':
ta... | [] |
Please provide a description of the function:def _run_cmd(cmd):
'''
Run a Kapacitor task and return a dictionary of info.
'''
ret = {}
env_vars = {
'KAPACITOR_URL': _get_url(),
'KAPACITOR_UNSAFE_SSL': __salt__['config.option']('kapacitor.unsafe_ssl', 'false'),
}
result = __sa... | [] |
Please provide a description of the function:def define_task(name,
tick_script,
task_type='stream',
database=None,
retention_policy='default',
dbrps=None):
'''
Define a task. Serves as both create/update.
name
Name of t... | [] |
Please provide a description of the function:def _ip_ifaces():
'''
Parse output from 'ip a'
'''
tmp = {}
ret = {}
if_ = None
at_ = None
out = __salt__['cmd.run']('ip a')
for line in out.splitlines():
if not line.startswith(' '):
comps = line.split(':')
... | [] |
Please provide a description of the function:def _parse_routes():
'''
Parse the contents of ``/proc/net/route``
'''
with salt.utils.files.fopen('/proc/net/route', 'r') as fp_:
out = salt.utils.stringutils.to_unicode(fp_.read())
ret = {}
for line in out.splitlines():
tmp = {}
... | [] |
Please provide a description of the function:def _hex_to_octets(addr):
'''
Convert hex fields from /proc/net/route to octects
'''
return '{0}:{1}:{2}:{3}'.format(
int(addr[6:8], 16),
int(addr[4:6], 16),
int(addr[2:4], 16),
int(addr[0:2], 16),
) | [] |
Please provide a description of the function:def _route_flags(rflags):
'''
https://github.com/torvalds/linux/blob/master/include/uapi/linux/route.h
https://github.com/torvalds/linux/blob/master/include/uapi/linux/ipv6_route.h
'''
flags = ''
fmap = {
0x0001: 'U', # RTF_UP, route is up
... | [] |
Please provide a description of the function:def _get_state():
'''
Returns the state of connman
'''
try:
return pyconnman.ConnManager().get_property('State')
except KeyError:
return 'offline'
except dbus.DBusException as exc:
raise salt.exceptions.CommandExecutionError('C... | [] |
Please provide a description of the function:def _get_technologies():
'''
Returns the technologies of connman
'''
tech = ''
technologies = pyconnman.ConnManager().get_technologies()
for path, params in technologies:
tech += '{0}\n\tName = {1}\n\tType = {2}\n\tPowered = {3}\n\tConnected =... | [] |
Please provide a description of the function:def _get_services():
'''
Returns a list with all connman services
'''
serv = []
services = pyconnman.ConnManager().get_services()
for path, _ in services:
serv.append(six.text_type(path[len(SERVICE_PATH):]))
return serv | [] |
Please provide a description of the function:def _connected(service):
'''
Verify if a connman service is connected
'''
state = pyconnman.ConnService(os.path.join(SERVICE_PATH, service)).get_property('State')
return state == 'online' or state == 'ready' | [] |
Please provide a description of the function:def _validate_ipv4(value):
'''
validate ipv4 values
'''
if len(value) == 3:
if not salt.utils.validate.net.ipv4_addr(value[0].strip()):
return False, 'Invalid ip address: {0} for ipv4 option'.format(value[0])
if not salt.utils.vali... | [] |
Please provide a description of the function:def _interface_to_service(iface):
'''
returns the coresponding service to given interface if exists, otherwise return None
'''
for _service in _get_services():
service_info = pyconnman.ConnService(os.path.join(SERVICE_PATH, _service))
if servi... | [] |
Please provide a description of the function:def _get_service_info(service):
'''
return details about given connman service
'''
service_info = pyconnman.ConnService(os.path.join(SERVICE_PATH, service))
data = {
'label': service,
'wireless': service_info.get_property('Type') == 'wifi'... | [] |
Please provide a description of the function:def _get_dns_info():
'''
return dns list
'''
dns_list = []
try:
with salt.utils.files.fopen('/etc/resolv.conf', 'r+') as dns_info:
lines = dns_info.readlines()
for line in lines:
if 'nameserver' in line:
... | [] |
Please provide a description of the function:def _load_config(section, options, default_value='', filename=INI_FILE):
'''
Get values for some options and a given section from a config file.
:param section: Section Name
:param options: List of options
:param default_value: Default value if an option... | [] |
Please provide a description of the function:def _get_request_mode_info(interface):
'''
return requestmode for given interface
'''
settings = _load_config(interface, ['linklocalenabled', 'dhcpenabled'], -1)
link_local_enabled = int(settings['linklocalenabled'])
dhcp_enabled = int(settings['dhcpe... | [] |
Please provide a description of the function:def _get_possible_adapter_modes(interface, blacklist):
'''
Return possible adapter modes for a given interface using a blacklist.
:param interface: interface name
:param blacklist: given blacklist
:return: list of possible adapter modes
'''
adapt... | [] |
Please provide a description of the function:def _get_static_info(interface):
'''
Return information about an interface from config file.
:param interface: interface label
'''
data = {
'connectionid': interface.name,
'label': interface.name,
'hwaddr': interface.hwaddr[:-1],
... | [] |
Please provide a description of the function:def _get_base_interface_info(interface):
'''
return base details about given interface
'''
blacklist = {
'tcpip': {
'name': [],
'type': [],
'additional_protocol': False
},
'disabled': {
'... | [] |
Please provide a description of the function:def _get_ethercat_interface_info(interface):
'''
return details about given ethercat interface
'''
base_information = _get_base_interface_info(interface)
base_information['ethercat'] = {
'masterid': _load_config(interface.name, ['MasterID'])['Mast... | [] |
Please provide a description of the function:def _get_tcpip_interface_info(interface):
'''
return details about given tcpip interface
'''
base_information = _get_base_interface_info(interface)
if base_information['ipv4']['requestmode'] == 'static':
settings = _load_config(interface.name, ['I... | [] |
Please provide a description of the function:def _get_interface_info(interface):
'''
return details about given interface
'''
adapter_mode = _get_adapter_mode_info(interface.name)
if adapter_mode == 'disabled':
return _get_base_interface_info(interface)
elif adapter_mode == 'ethercat':
... | [] |
Please provide a description of the function:def _dict_to_string(dictionary):
'''
converts a dictionary object into a list of strings
'''
ret = ''
for key, val in sorted(dictionary.items()):
if isinstance(val, dict):
for line in _dict_to_string(val):
ret += six.te... | [] |
Please provide a description of the function:def get_interfaces_details():
'''
Get details about all the interfaces on the minion
:return: information about all interfaces omitting loopback
:rtype: dictionary
CLI Example:
.. code-block:: bash
salt '*' ip.get_interfaces_details
''... | [] |
Please provide a description of the function:def _change_state_legacy(interface, new_state):
'''
Enable or disable an interface on a legacy distro
Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.
:param interface: interface label
:param new_state: ... | [] |
Please provide a description of the function:def _change_state(interface, new_state):
'''
Enable or disable an interface
Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.
:param interface: interface label
:param new_state: up or down
:return: Tr... | [] |
Please provide a description of the function:def _save_config(section, token, value):
'''
Helper function to persist a configuration in the ini file
'''
cmd = NIRTCFG_PATH
cmd += ' --set section={0},token=\'{1}\',value=\'{2}\''.format(section, token, value)
if __salt__['cmd.run_all'](cmd)['retco... | [] |
Please provide a description of the function:def set_ethercat(interface, master_id):
'''
Configure specified adapter to use EtherCAT adapter mode. If successful, the target will need reboot if it doesn't
already use EtherCAT adapter mode, otherwise will return true.
:param interface: interface label
... | [] |
Please provide a description of the function:def set_dhcp_linklocal_all(interface):
'''
Configure specified adapter to use DHCP with linklocal fallback
Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.
:param str interface: interface label
:return: ... | [] |
Please provide a description of the function:def set_dhcp_only_all(interface):
'''
Configure specified adapter to use DHCP only
Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.
:param str interface: interface label
:return: True if the settings wer... | [] |
Please provide a description of the function:def _configure_static_interface(interface, **settings):
'''
Configure an interface that is not detected as a service by Connman (i.e. link is down)
:param interface: interface label
:param settings:
- ip
- netmask
- gatewa... | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.