text stringlengths 81 112k |
|---|
Get a model by name for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_model restApiId modelName [True]
def describe_api_model(restApiId, modelName, flatten=True, region=None, key=None, keyid=None, profile=None):
'''
Get a model by name for a given A... |
Check to see if the given modelName exists in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.api_model_exists restApiId modelName
def api_model_exists(restApiId, modelName, region=None, key=None, keyid=None, profile=None):
'''
Check to see if the given mo... |
the replace patch operation on a Model resource
def _api_model_patch_replace(conn, restApiId, modelName, path, value):
'''
the replace patch operation on a Model resource
'''
response = conn.update_model(restApiId=restApiId, modelName=modelName,
patchOperations=[{'op': ... |
update the schema (in python dictionary format) for the given model in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_model_schema restApiId modelName schema
def update_api_model_schema(restApiId, modelName, schema, region=None, key=None, keyid=None, p... |
Delete a model identified by name in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_model restApiId modelName
def delete_api_model(restApiId, modelName, region=None, key=None, keyid=None, profile=None):
'''
Delete a model identified by name in a given ... |
Create a new model in a given API with a given schema, currently only contentType supported is
'application/json'
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_model restApiId modelName modelDescription '<schema>' 'content-type'
def create_api_model(restApiId, modelN... |
Get an integration for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_integration restApiId resourcePath httpMethod
def describe_api_integration(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
... |
Get an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_integration_response restApiId resourcePath httpMethod statusCode
def describe_api_integration_response(restApiId, resourcePath, httpMethod, statusCode,
... |
Deletes an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_integration_response restApiId resourcePath httpMethod statusCode
def delete_api_integration_response(restApiId, resourcePath, httpMethod, statusCode,
... |
Creates an integration for a given method in a given API.
If integrationType is MOCK, uri and credential parameters will be ignored.
uri is in the form of (substitute APIGATEWAY_REGION and LAMBDA_FUNC_ARN)
"arn:aws:apigateway:APIGATEWAY_REGION:lambda:path/2015-03-31/functions/LAMBDA_FUNC_ARN/invocations"
... |
Creates an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_integration_response restApiId resourcePath httpMethod \\
statusCode selectionPattern ['{}' ['{}']]
def create_api_integration_resp... |
Helper to return list of usage plan items matching the given attribute value.
def _filter_plans(attr, name, plans):
'''
Helper to return list of usage plan items matching the given attribute value.
'''
return [plan for plan in plans if plan[attr] == name] |
Returns a list of existing usage plans, optionally filtered to match a given plan name
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_usage_plans
salt myminion boto_apigateway.describe_usage_plans name='usage plan name'
salt my... |
Helper to verify that quota parameters are valid
def _validate_quota(quota):
'''
Helper to verify that quota parameters are valid
'''
if quota is not None:
if not isinstance(quota, dict):
raise TypeError('quota must be a dictionary, provided value: {0}'.format(quota))
period... |
Creates a new usage plan with throttling and quotas optionally applied
.. versionadded:: 2017.7.0
name
Name of the usage plan
throttle
A dictionary consisting of the following keys:
rateLimit
requests per second at steady rate, float
burstLimit
ma... |
Updates an existing usage plan with throttling and quotas
.. versionadded:: 2017.7.0
plan_id
Id of the created usage plan
throttle
A dictionary consisting of the following keys:
rateLimit
requests per second at steady rate, float
burstLimit
maximu... |
Deletes usage plan identified by plan_id
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_usage_plan plan_id='usage plan id'
def delete_usage_plan(plan_id, region=None, key=None, keyid=None, profile=None):
'''
Deletes usage plan identifie... |
Helper function that updates the usage plan identified by plan_id by adding or removing it to each of the stages, specified by apis parameter.
apis
a list of dictionaries, where each dictionary contains the following:
apiId
a string, which is the id of the created API in AWS ApiGateway... |
Attaches given usage plan to each of the apis provided in a list of apiId and stage values
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:
apiId
a string, which is the id of the created API in AWS ApiGateway
stage
... |
Detaches given usage plan from each of the apis provided in a list of apiId and stage value
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:
apiId
a string, which is the id of the created API in AWS ApiGateway
stage
... |
Return a simple vdev tree from zpool.status' config section
def _clean_vdev_config(config):
'''
Return a simple vdev tree from zpool.status' config section
'''
cln_config = OrderedDict()
for label, sub_config in config.items():
if label not in ['state', 'read', 'write', 'cksum']:
... |
Return the status of the named zpool
zpool : string
optional name of storage pool
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' zpool.status myzpool
def status(zpool=None):
'''
Return the status of the named zpool
zpool : string
optional... |
Display I/O statistics for the given pools
zpool : string
optional name of storage pool
sample_time : int
seconds to capture data before output
default a sample of 5 seconds is used
parsable : boolean
display data in pythonc values (True, False, Bytes,...)
.. versionad... |
.. versionadded:: 2015.5.0
Return information about (all) storage pools
zpool : string
optional name of storage pool
properties : string
comma-separated list of properties to list
parsable : boolean
display numbers in parsable (exact) values
.. versionadded:: 2018.3.... |
.. versionadded:: 2016.3.0
Retrieves the given list of properties
zpool : string
Name of storage pool
prop : string
Optional name of property to retrieve
show_source : boolean
Show source of property
parsable : boolean
Display numbers in parsable (exact) values
... |
Sets the given property on the specified pool
zpool : string
Name of storage pool
prop : string
Name of property to set
value : string
Value to set for the specified property
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' zpool.set my... |
Check if a ZFS storage pool is active
zpool : string
Name of storage pool
CLI Example:
.. code-block:: bash
salt '*' zpool.exists myzpool
def exists(zpool):
'''
Check if a ZFS storage pool is active
zpool : string
Name of storage pool
CLI Example:
.. code-... |
Destroys a storage pool
zpool : string
Name of storage pool
force : boolean
Force destroy of pool
CLI Example:
.. code-block:: bash
salt '*' zpool.destroy myzpool
def destroy(zpool, force=False):
'''
Destroys a storage pool
zpool : string
Name of storag... |
Scrub a storage pool
zpool : string
Name of storage pool
stop : boolean
If ``True``, cancel ongoing scrub
pause : boolean
If ``True``, pause ongoing scrub
.. versionadded:: 2018.3.0
.. note::
Pause is only available on recent versions of ZFS.
... |
.. versionadded:: 2015.5.0
Create a simple zpool, a mirrored zpool, a zpool having nested VDEVs, a hybrid zpool with cache, spare and log drives or a zpool with RAIDZ-1, RAIDZ-2 or RAIDZ-3
zpool : string
Name of storage pool
vdevs : string
One or move devices
force : boolean
... |
Add the specified vdev\'s to the given storage pool
zpool : string
Name of storage pool
vdevs : string
One or more devices
force : boolean
Forces use of device
CLI Example:
.. code-block:: bash
salt '*' zpool.add myzpool /path/to/vdev1 /path/to/vdev2 [...]
def ... |
Attach specified device to zpool
zpool : string
Name of storage pool
device : string
Existing device name too
new_device : string
New device name (to be attached to ``device``)
force : boolean
Forces use of device
CLI Example:
.. code-block:: bash
s... |
Detach specified device to zpool
zpool : string
Name of storage pool
device : string
Device to detach
CLI Example:
.. code-block:: bash
salt '*' zpool.detach myzpool /path/to/vdev1
def detach(zpool, device):
'''
Detach specified device to zpool
zpool : string
... |
.. versionadded:: 2018.3.0
Splits devices off pool creating newpool.
.. note::
All vdevs in pool must be mirrors. At the time of the split,
``newzpool`` will be a replica of ``zpool``.
After splitting, do not forget to import the new pool!
zpool : string
Name of storage... |
Replaces ``old_device`` with ``new_device``
.. note::
This is equivalent to attaching ``new_device``,
waiting for it to resilver, and then detaching ``old_device``.
The size of ``new_device`` must be greater than or equal to the minimum
size of all the devices in a mirror or raidz... |
Creates file based virtual devices for a zpool
CLI Example:
.. code-block:: bash
salt '*' zpool.create_file_vdev 7G /path/to/vdev1 [/path/to/vdev2] [...]
.. note::
Depending on file size, the above command may take a while to return.
def create_file_vdev(size, *vdevs):
'''
Crea... |
.. versionadded:: 2015.5.0
Export storage pools
pools : string
One or more storage pools to export
force : boolean
Force export of storage pools
CLI Example:
.. code-block:: bash
salt '*' zpool.export myzpool ... [force=True|False]
salt '*' zpool.export myzpool2... |
.. versionadded:: 2015.5.0
Import storage pools or list pools available for import
zpool : string
Optional name of storage pool
new_name : string
Optional new name for the storage pool
mntopts : string
Comma-separated list of mount options to use when mounting datasets
... |
.. versionadded:: 2015.5.0
Ensure that the specified devices are online
zpool : string
name of storage pool
vdevs : string
one or more devices
expand : boolean
Expand the device to use all available space.
.. note::
If the device is part of a mirror or r... |
.. versionadded:: 2015.5.0
Ensure that the specified devices are offline
.. warning::
By default, the ``OFFLINE`` state is persistent. The device remains
offline when the system is rebooted. To temporarily take a device
offline, use ``temporary=True``.
zpool : string
name... |
.. versionadded:: 2018.3.0
Removes ZFS label information from the specified device
device : string
Device name; must not be part of an active pool configuration.
force : boolean
Treat exported or foreign devices as inactive
CLI Example:
.. code-block:: bash
salt '*' zpo... |
Clears device errors in a pool.
.. warning::
The device must not be part of an active pool configuration.
zpool : string
name of storage pool
device : string
(optional) specific device to clear
.. versionadded:: 2018.3.1
CLI Example:
.. code-block:: bash
sa... |
Generates a new unique identifier for the pool
.. warning::
You must ensure that all devices in this pool are online and healthy
before performing this action.
zpool : string
name of storage pool
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt ... |
.. versionadded:: 2016.3.0
Enables all supported features on the given pool
zpool : string
Optional storage pool, applies to all otherwize
version : int
Version to upgrade to, if unspecified upgrade to the highest possible
.. warning::
Once this is done, the pool will no long... |
.. versionadded:: 2016.3.0
Displays the command history of the specified pools, or all pools if no
pool is specified
zpool : string
Optional storage pool
internal : boolean
Toggle display of internally logged ZFS events
verbose : boolean
Toggle display of the user name, t... |
Ensure that the user is present with the specified properties
name
The name of the user to manage
passwd
The password of the user to manage
user
MongoDB user with sufficient privilege to create the user
password
Password for the admin user specified with the ``user`` ... |
Ensure that the named user is absent
name
The name of the user to remove
user
MongoDB user with sufficient privilege to create the user
password
Password for the admin user specified by the ``user`` parameter
host
The hostname/IP address of the MongoDB server
por... |
Check to see if an autoscale group exists.
CLI example::
salt myminion boto_asg.exists myasg region=us-east-1
def exists(name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if an autoscale group exists.
CLI example::
salt myminion boto_asg.exists myasg region=us... |
Get the configuration for an autoscale group.
CLI example::
salt myminion boto_asg.get_config myasg region=us-east-1
def get_config(name, region=None, key=None, keyid=None, profile=None):
'''
Get the configuration for an autoscale group.
CLI example::
salt myminion boto_asg.get_conf... |
Create an autoscale group.
CLI example::
salt myminion boto_asg.create myasg mylc '["us-east-1a", "us-east-1e"]' 1 10 load_balancers='["myelb", "myelb2"]' tags='[{"key": "Name", value="myasg", "propagate_at_launch": True}]'
def create(name, launch_config_name, availability_zones, min_size, max_size,
... |
Update an autoscale group.
CLI example::
salt myminion boto_asg.update myasg mylc '["us-east-1a", "us-east-1e"]' 1 10 load_balancers='["myelb", "myelb2"]' tags='[{"key": "Name", value="myasg", "propagate_at_launch": True}]'
def update(name, launch_config_name, availability_zones, min_size, max_size,
... |
helper function to create scaling policies
def _create_scaling_policies(conn, as_name, scaling_policies):
'helper function to create scaling policies'
if scaling_policies:
for policy in scaling_policies:
policy = autoscale.policy.ScalingPolicy(
name=policy["name"],
... |
Helper function to create scheduled actions
def _create_scheduled_actions(conn, as_name, scheduled_actions):
'''
Helper function to create scheduled actions
'''
if scheduled_actions:
for name, action in six.iteritems(scheduled_actions):
if 'start_time' in action and isinstance(actio... |
Get a mime multipart encoded string from a cloud-init dict. Currently
supports boothooks, scripts and cloud-config.
CLI Example:
.. code-block:: bash
salt myminion boto.get_cloud_init_mime <cloud init>
def get_cloud_init_mime(cloud_init):
'''
Get a mime multipart encoded string from a cl... |
Check for a launch configuration's existence.
CLI example::
salt myminion boto_asg.launch_configuration_exists mylc
def launch_configuration_exists(name, region=None, key=None, keyid=None,
profile=None):
'''
Check for a launch configuration's existence.
CLI ex... |
Fetch and return all Launch Configuration with details.
CLI example::
salt myminion boto_asg.get_all_launch_configurations
def get_all_launch_configurations(region=None, key=None, keyid=None,
profile=None):
'''
Fetch and return all Launch Configuration with detai... |
List all Launch Configurations.
CLI example::
salt myminion boto_asg.list_launch_configurations
def list_launch_configurations(region=None, key=None, keyid=None,
profile=None):
'''
List all Launch Configurations.
CLI example::
salt myminion boto_asg.l... |
Create a launch configuration.
CLI example::
salt myminion boto_asg.create_launch_configuration mylc image_id=ami-0b9c9f62 key_name='mykey' security_groups='["mygroup"]' instance_type='c3.2xlarge'
def create_launch_configuration(name, image_id, key_name=None,
vpc_id=None, ... |
Delete a launch configuration.
CLI example::
salt myminion boto_asg.delete_launch_configuration mylc
def delete_launch_configuration(name, region=None, key=None, keyid=None,
profile=None):
'''
Delete a launch configuration.
CLI example::
salt myminion... |
Return the arn for a scaling policy in a specific autoscale group or None
if not found. Mainly used as a helper method for boto_cloudwatch_alarm, for
linking alarms to scaling policies.
CLI Example::
salt '*' boto_asg.get_scaling_policy_arn mygroup mypolicy
def get_scaling_policy_arn(as_group, sc... |
Return all AutoScale Groups visible in the account
(as a list of boto.ec2.autoscale.group.AutoScalingGroup).
.. versionadded:: 2016.11.0
CLI example:
.. code-block:: bash
salt-call boto_asg.get_all_groups region=us-east-1 --output yaml
def get_all_groups(region=None, key=None, keyid=None, p... |
Return all AutoScale Groups visible in the account
(as a list of names).
.. versionadded:: 2016.11.0
CLI example:
.. code-block:: bash
salt-call boto_asg.list_groups region=us-east-1
def list_groups(region=None, key=None, keyid=None, profile=None):
'''
Return all AutoScale Groups vi... |
return attribute of all instances in the named autoscale group.
CLI example::
salt-call boto_asg.get_instances my_autoscale_group_name
def get_instances(name, lifecycle_state="InService", health_status="Healthy",
attribute="private_ip_address", attributes=None, region=None,
... |
Exit desired instances from StandBy mode
.. versionadded:: 2016.11.0
CLI example::
salt-call boto_asg.exit_standby my_autoscale_group_name '["i-xxxxxx"]'
def exit_standby(name, instance_ids, should_decrement_desired_capacity=False,
region=None, key=None, keyid=None, profile=None):
... |
List SCSI devices, with details
CLI Examples:
.. code-block:: bash
salt '*' scsi.ls
salt '*' scsi.ls get_size=False
get_size : True
Get the size information for scsi devices. This option
should be set to False for older OS distributions (RHEL6 and older)
due to l... |
List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.rescan_all 0
def rescan_all(host):
'''
List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.rescan_all 0
'''
if os.path.isdir('/sys/class/scsi_host/host{0}'.format(host)):
cmd = ... |
Retrieves the vsan_datastore
def _get_vsan_datastore(si, cluster_name):
'''Retrieves the vsan_datastore'''
log.trace('Retrieving vsan datastore')
vsan_datastores = [ds for ds in
__salt__['vsphere.list_datastores_via_proxy'](
service_instance=si)
... |
Configures a cluster. Creates a new cluster, if it doesn't exist on the
vCenter or reconfigures it if configured differently
Supported proxies: esxdatacenter, esxcluster
name
Name of the state. If the state is run in by an ``esxdatacenter``
proxy, it will be the name of the cluster.
c... |
Configures the cluster's VSAN datastore
WARNING: The VSAN datastore is created automatically after the first
ESXi host is added to the cluster; the state assumes that the datastore
exists and errors if it doesn't.
def vsan_datastore_configured(name, datastore_name):
'''
Configures the cluster's VS... |
Configures licenses on the cluster entity
Checks if each license exists on the server:
- if it doesn't, it creates it
Check if license is assigned to the cluster:
- if it's not assigned to the cluster:
- assign it to the cluster if there is space
- error if there's no sp... |
Get system encoding. Most of this code is a part of salt/__init__.py
def get_system_encoding():
'''
Get system encoding. Most of this code is a part of salt/__init__.py
'''
# This is the most trustworthy source of the system encoding, though, if
# salt is being imported after being daemonized, ... |
Salt thin needs to be deployed - prep the target directory and emit the
delimiter and exit code that signals a required deployment.
def need_deployment():
'''
Salt thin needs to be deployed - prep the target directory and emit the
delimiter and exit code that signals a required deployment.
'''
... |
Generate a hash digest string for a file.
def get_hash(path, form='sha1', chunk_size=4096):
'''
Generate a hash digest string for a file.
'''
try:
hash_type = getattr(hashlib, form)
except AttributeError:
raise ValueError('Invalid hash type: {0}'.format(form))
with open(path, 'r... |
Unpack the Salt thin archive.
def unpack_thin(thin_path):
'''
Unpack the Salt thin archive.
'''
tfile = tarfile.TarFile.gzopen(thin_path)
old_umask = os.umask(0o077) # pylint: disable=blacklisted-function
tfile.extractall(path=OPTIONS.saltdir)
tfile.close()
os.umask(old_umask) # pylin... |
Signal that external modules need to be deployed.
def need_ext():
'''
Signal that external modules need to be deployed.
'''
sys.stdout.write("{0}\next_mods\n".format(OPTIONS.delimiter))
sys.exit(EX_MOD_DEPLOY) |
Unpack the external modules.
def unpack_ext(ext_path):
'''
Unpack the external modules.
'''
modcache = os.path.join(
OPTIONS.saltdir,
'running_data',
'var',
'cache',
'salt',
'minion',
'extmods')
tfile = tarfile.TarF... |
Reset atime/mtime on all files to prevent systemd swipes only part of the files in the /tmp.
def reset_time(path='.', amt=None):
'''
Reset atime/mtime on all files to prevent systemd swipes only part of the files in the /tmp.
'''
if not amt:
amt = int(time.time())
for fname in os.listdir(pa... |
Find executable which matches supported python version in the thin
def get_executable():
'''
Find executable which matches supported python version in the thin
'''
pymap = {}
with open(os.path.join(OPTIONS.saltdir, 'supported-versions')) as _fp:
for line in _fp.readlines():
ns, ... |
Main program body
def main(argv): # pylint: disable=W0613
'''
Main program body
'''
thin_path = os.path.join(OPTIONS.saltdir, THIN_ARCHIVE)
if os.path.isfile(thin_path):
if OPTIONS.checksum != get_hash(thin_path, OPTIONS.hashfunc):
need_deployment()
unpack_thin(thin_pat... |
Mount the device in a temporary place.
def _mount(device):
'''
Mount the device in a temporary place.
'''
dest = tempfile.mkdtemp()
res = __states__['mount.mounted'](dest, device=device, fstype='btrfs',
opts='subvol=/', persist=False)
if not res['result']:
... |
Check if the subvolume is the current default.
def _is_default(path, dest, name):
'''
Check if the subvolume is the current default.
'''
subvol_id = __salt__['btrfs.subvolume_show'](path)[name]['subvolume id']
def_id = __salt__['btrfs.subvolume_get_default'](dest)['id']
return subvol_id == def_... |
Set the subvolume as the current default.
def _set_default(path, dest, name):
'''
Set the subvolume as the current default.
'''
subvol_id = __salt__['btrfs.subvolume_show'](path)[name]['subvolume id']
return __salt__['btrfs.subvolume_set_default'](subvol_id, dest) |
Check if the subvolume is copy on write
def _is_cow(path):
'''
Check if the subvolume is copy on write
'''
dirname = os.path.dirname(path)
return 'C' not in __salt__['file.lsattr'](dirname)[path] |
Small decorator to makes sure that the mount and umount happends in
a transactional way.
def __mount_device(action):
'''
Small decorator to makes sure that the mount and umount happends in
a transactional way.
'''
@functools.wraps(action)
def wrapper(*args, **kwargs):
name = kwargs[... |
Makes sure that a btrfs subvolume is present.
name
Name of the subvolume to add
device
Device where to create the subvolume
qgroupids
Add the newly created subcolume to a qgroup. This parameter
is a list
set_default
If True, this new subvolume will be set as... |
Makes sure that a btrfs subvolume is removed.
name
Name of the subvolume to remove
device
Device where to remove the subvolume
commit
Wait until the transaction is over
def subvolume_deleted(name, device, commit=False, __dest=None):
'''
Makes sure that a btrfs subvolume i... |
Execute a command and read the output as YAML
def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
command):
'''
Execute a command and read the output as YAML
'''
try:
command = command.replace('%s', minion_id)
output = __salt... |
.. versionadded:: Fluorine
Ensure a DNS zone exists.
:param name:
Name of the DNS zone (without a terminating dot).
:param resource_group:
The resource group assigned to the DNS zone.
:param etag:
The etag of the zone. `Etags <https://docs.microsoft.com/en-us/azure/dns/dns-zo... |
.. versionadded:: Fluorine
Ensure a DNS zone does not exist in the resource group.
:param name:
Name of the DNS zone.
:param resource_group:
The resource group assigned to the DNS zone.
:param connection_auth:
A dict with subscription and authentication parameters to be used ... |
.. versionadded:: Fluorine
Ensure a record set exists in a DNS zone.
:param name:
The name of the record set, relative to the name of the zone.
:param zone_name:
Name of the DNS zone (without a terminating dot).
:param resource_group:
The resource group assigned to the DNS zo... |
.. versionadded:: Fluorine
Ensure a record set does not exist in the DNS zone.
:param name:
Name of the record set.
:param zone_name:
Name of the DNS zone.
:param resource_group:
The resource group assigned to the DNS zone.
:param connection_auth:
A dict with sub... |
Parse the given atom, allowing access to its parts
Success does not mean that the atom exists, just that it
is in the correct format.
Returns none if the atom is invalid.
def _get_config_file(conf, atom):
'''
Parse the given atom, allowing access to its parts
Success does not mean that the atom... |
add version to category/package
@cp - name of package in format category/name
@installed - boolean value, if False, function returns cpv
for latest available package
def _get_cpv(cp, installed=True):
'''
add version to category/package
@cp - name of package in format category/name
@installe... |
Merge /etc/portage/package.keywords and
/etc/portage/package.accept_keywords.
def _unify_keywords():
'''
Merge /etc/portage/package.keywords and
/etc/portage/package.accept_keywords.
'''
old_path = BASE_PATH.format('keywords')
if os.path.exists(old_path):
if os.path.isdir(old_path):... |
Convert a config file to a config directory.
def _package_conf_file_to_dir(file_name):
'''
Convert a config file to a config directory.
'''
if file_name in SUPPORTED_CONFS:
path = BASE_PATH.format(file_name)
if os.path.exists(path):
if os.path.isdir(path):
re... |
Move entries in the correct file.
def _package_conf_ordering(conf, clean=True, keep_backup=False):
'''
Move entries in the correct file.
'''
if conf in SUPPORTED_CONFS:
rearrange = []
path = BASE_PATH.format(conf)
backup_files = []
for triplet in salt.utils.path.os_wal... |
check compatibility of accept_keywords
def _check_accept_keywords(approved, flag):
'''check compatibility of accept_keywords'''
if flag in approved:
return False
elif (flag.startswith('~') and flag[1:] in approved) \
or ('~'+flag in approved):
return False
else:
retu... |
Merges multiple lists of flags removing duplicates and resolving conflicts
giving priority to lasts lists.
def _merge_flags(new_flags, old_flags=None, conf='any'):
'''
Merges multiple lists of flags removing duplicates and resolving conflicts
giving priority to lasts lists.
'''
if not old_flags... |
Append a string or a list of flags for a given package or DEPEND atom to a
given configuration file.
CLI Example:
.. code-block:: bash
salt '*' portage_config.append_to_package_conf use string="app-admin/salt ldap -libvirt"
salt '*' portage_config.append_to_package_conf use atom="> = app-... |
Append a list of use flags for a given package or DEPEND atom
CLI Example:
.. code-block:: bash
salt '*' portage_config.append_use_flags "app-admin/salt[ldap, -libvirt]"
salt '*' portage_config.append_use_flags ">=app-admin/salt-0.14.1" "['ldap', '-libvirt']"
def append_use_flags(atom, uses=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.