Search is not available for this dataset
text stringlengths 75 104k |
|---|
def describe_api_model(restApiId, modelName, flatten=True, region=None, key=None, keyid=None, profile=None):
'''
Get a model by name for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_model restApiId modelName [True]
'''
try:
conn = _... |
def api_model_exists(restApiId, modelName, region=None, key=None, keyid=None, profile=None):
'''
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
'''
r = describe_api_... |
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': 'replace', 'path': path, 'value': value}])
re... |
def update_api_model_schema(restApiId, modelName, schema, region=None, key=None, keyid=None, profile=None):
'''
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 re... |
def delete_api_model(restApiId, modelName, region=None, key=None, keyid=None, profile=None):
'''
Delete a model identified by name in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_model restApiId modelName
'''
try:
conn = _get_conn(reg... |
def create_api_model(restApiId, modelName, modelDescription, schema, contentType='application/json',
region=None, key=None, keyid=None, profile=None):
'''
Create a new model in a given API with a given schema, currently only contentType supported is
'application/json'
CLI Example:
... |
def describe_api_integration(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
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 httpMeth... |
def describe_api_integration_response(restApiId, resourcePath, httpMethod, statusCode,
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... |
def delete_api_integration_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Deletes an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto... |
def create_api_integration(restApiId, resourcePath, httpMethod, integrationType, integrationHttpMethod,
uri, credentials, requestParameters=None, requestTemplates=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates an integration for a given ... |
def create_api_integration_response(restApiId, resourcePath, httpMethod, statusCode, selectionPattern,
responseParameters=None, responseTemplates=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates an integration response fo... |
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] |
def describe_usage_plans(name=None, plan_id=None, region=None, key=None, keyid=None, profile=None):
'''
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.descri... |
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))
periods = ['DAY', 'WEEK', 'MONTH']
if 'period' n... |
def create_usage_plan(name, description=None, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None):
'''
Creates a new usage plan with throttling and quotas optionally applied
.. versionadded:: 2017.7.0
name
Name of the usage plan
throttle
A dictionary consis... |
def update_usage_plan(plan_id, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None):
'''
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 followi... |
def delete_usage_plan(plan_id, region=None, key=None, keyid=None, profile=None):
'''
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'
'''
try:
exi... |
def _update_usage_plan_apis(plan_id, apis, op, region=None, key=None, keyid=None, profile=None):
'''
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 cont... |
def attach_usage_plan_to_apis(plan_id, apis, region=None, key=None, keyid=None, profile=None):
'''
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:
... |
def detach_usage_plan_from_apis(plan_id, apis, region=None, key=None, keyid=None, profile=None):
'''
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:... |
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']:
sub_config = _clean_vdev_config(sub_config)
if... |
def status(zpool=None):
'''
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
'''
ret = OrderedDict()
## collect status output
res = _... |
def iostat(zpool=None, sample_time=5, parsable=True):
'''
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... |
def list_(properties='size,alloc,free,cap,frag,health', zpool=None, parsable=True):
'''
.. 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... |
def get(zpool, prop=None, show_source=False, parsable=True):
'''
.. 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
... |
def set(zpool, prop, value):
'''
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-bl... |
def exists(zpool):
'''
Check if a ZFS storage pool is active
zpool : string
Name of storage pool
CLI Example:
.. code-block:: bash
salt '*' zpool.exists myzpool
'''
# list for zpool
# NOTE: retcode > 0 if zpool does not exists
res = __salt__['cmd.run_all'](
... |
def destroy(zpool, force=False):
'''
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
'''
# destroy zpool
res = __salt__['cmd.run_all'](
... |
def scrub(zpool, stop=False, pause=False):
'''
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::
Pau... |
def create(zpool, *vdevs, **kwargs):
'''
.. 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
... |
def add(zpool, *vdevs, **kwargs):
'''
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 myz... |
def attach(zpool, device, new_device, force=False):
'''
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 ... |
def detach(zpool, device):
'''
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
'''
## Update storage pool
res = __salt__[... |
def split(zpool, newzpool, **kwargs):
'''
.. 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... |
def replace(zpool, old_device, new_device=None, force=False):
'''
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... |
def create_file_vdev(size, *vdevs):
'''
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 export(*pools, **kwargs):
'''
.. 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|Fal... |
def import_(zpool=None, new_name=None, **kwargs):
'''
.. 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-separa... |
def online(zpool, *vdevs, **kwargs):
'''
.. 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::
... |
def offline(zpool, *vdevs, **kwargs):
'''
.. 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 ``... |
def labelclear(device, force=False):
'''
.. 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... |
def clear(zpool, device=None):
'''
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 Exa... |
def reguid(zpool):
'''
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:
.. c... |
def upgrade(zpool=None, version=None):
'''
.. 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... |
def history(zpool=None, internal=False, verbose=False):
'''
.. 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 even... |
def present(name,
passwd,
database="admin",
user=None,
password=None,
host="localhost",
port=27017,
authdb=None,
roles=None):
'''
Ensure that the user is present with the specified properties
name
The na... |
def absent(name,
user=None,
password=None,
host=None,
port=None,
database="admin",
authdb=None):
'''
Ensure that the named user is absent
name
The name of the user to remove
user
MongoDB user with sufficient privilege to... |
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-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
retries = 30
while True:
... |
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_config myasg region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
retries = 30
wh... |
def create(name, launch_config_name, availability_zones, min_size, max_size,
desired_capacity=None, load_balancers=None, default_cooldown=None,
health_check_type=None, health_check_period=None,
placement_group=None, vpc_zone_identifier=None, tags=None,
termination_policies=No... |
def update(name, launch_config_name, availability_zones, min_size, max_size,
desired_capacity=None, load_balancers=None, default_cooldown=None,
health_check_type=None, health_check_period=None,
placement_group=None, vpc_zone_identifier=None, tags=None,
termination_policies=No... |
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"],
as_name=as_name,
adju... |
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(action['start_time'], six.string_types):
... |
def get_cloud_init_mime(cloud_init):
'''
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>
'''
if isinstance(cloud_init, six.stri... |
def launch_configuration_exists(name, region=None, key=None, keyid=None,
profile=None):
'''
Check for a launch configuration's existence.
CLI example::
salt myminion boto_asg.launch_configuration_exists mylc
'''
conn = _get_conn(region=region, key=key, keyid... |
def get_all_launch_configurations(region=None, key=None, keyid=None,
profile=None):
'''
Fetch and return all Launch Configuration with details.
CLI example::
salt myminion boto_asg.get_all_launch_configurations
'''
conn = _get_conn(region=region, key=key, ... |
def list_launch_configurations(region=None, key=None, keyid=None,
profile=None):
'''
List all Launch Configurations.
CLI example::
salt myminion boto_asg.list_launch_configurations
'''
ret = get_all_launch_configurations(region, key, keyid, profile)
retu... |
def create_launch_configuration(name, image_id, key_name=None,
vpc_id=None, vpc_name=None,
security_groups=None, user_data=None,
instance_type='m1.small', kernel_id=None,
ramdisk_id=None, bloc... |
def delete_launch_configuration(name, region=None, key=None, keyid=None,
profile=None):
'''
Delete a launch configuration.
CLI example::
salt myminion boto_asg.delete_launch_configuration mylc
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile... |
def get_scaling_policy_arn(as_group, scaling_policy_name, region=None,
key=None, keyid=None, profile=None):
'''
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 ... |
def get_all_groups(region=None, key=None, keyid=None, profile=None):
'''
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... |
def list_groups(region=None, key=None, keyid=None, profile=None):
'''
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
'''
return [a.name for... |
def get_instances(name, lifecycle_state="InService", health_status="Healthy",
attribute="private_ip_address", attributes=None, region=None,
key=None, keyid=None, profile=None):
'''
return attribute of all instances in the named autoscale group.
CLI example::
sal... |
def exit_standby(name, instance_ids, should_decrement_desired_capacity=False,
region=None, key=None, keyid=None, profile=None):
'''
Exit desired instances from StandBy mode
.. versionadded:: 2016.11.0
CLI example::
salt-call boto_asg.exit_standby my_autoscale_group_name '["i... |
def ls_(get_size=True):
'''
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 distribution... |
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 = 'echo "- - -" > /sys/class/scsi_host/host{0}/scan'.format(host)
else:
return 'Host {0} ... |
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)
if ds['type'] == ... |
def cluster_configured(name, cluster_config):
'''
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``... |
def vsan_datastore_configured(name, datastore_name):
'''
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.
'''
cluster_name, d... |
def licenses_configured(name, licenses=None):
'''
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 clus... |
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, this information is lost
# and reset to None
encoding = None
... |
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.
'''
if os.path.exists(OPTIONS.saltdir):
shutil.rmtree(OPTIONS.saltdir)
old_umask = os.umask(0o077) # pylint: disable=blacklisted... |
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, 'rb') as ifile:
hash_obj = hash_type(... |
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) # pylint: disable=blacklisted-function... |
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) |
def unpack_ext(ext_path):
'''
Unpack the external modules.
'''
modcache = os.path.join(
OPTIONS.saltdir,
'running_data',
'var',
'cache',
'salt',
'minion',
'extmods')
tfile = tarfile.TarFile.gzopen(ext_path)
old_u... |
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(path):
fname = os.path.join(path, fname)
if os.path.isdir(fname):
re... |
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, v_maj, v_min = line.strip().split(':')
pymap[ns] = (int(... |
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_path)
# Salt t... |
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']:
log.error('Cannot mount device %... |
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_id |
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) |
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] |
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['name']
device = kwargs['device']
ret = {
'name': name,
... |
def subvolume_created(name, device, qgroupids=None, set_default=False,
copy_on_write=True, force_set_default=True,
__dest=None):
'''
Makes sure that a btrfs subvolume is present.
name
Name of the subvolume to add
device
Device where to create... |
def subvolume_deleted(name, device, commit=False, __dest=None):
'''
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
'''
ret = {
'name':... |
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__['cmd.run_stdout'](command, python_shell=True... |
def zone_present(name, resource_group, etag=None, if_match=None, if_none_match=None,
registration_virtual_networks=None, resolution_virtual_networks=None,
tags=None, zone_type='Public', connection_auth=None, **kwargs):
'''
.. versionadded:: Fluorine
Ensure a DNS zone exist... |
def zone_absent(name, resource_group, connection_auth=None):
'''
.. 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:
... |
def record_set_present(name, zone_name, resource_group, record_type, if_match=None, if_none_match=None,
etag=None, metadata=None, ttl=None, arecords=None, aaaa_records=None, mx_records=None,
ns_records=None, ptr_records=None, srv_records=None, txt_records=None, cname_record... |
def record_set_absent(name, zone_name, resource_group, connection_auth=None):
'''
.. 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 res... |
def _get_config_file(conf, atom):
'''
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.
'''
if '*' in atom:
parts = portage.dep.Atom(atom, allow_wildcard=True)
... |
def _get_cpv(cp, installed=True):
'''
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
'''
if installed:
return _get_portage().db[portage.root]['vartree'].dep_bestmatc... |
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):
for triplet in salt.utils.path.os_walk(old_path):
for ... |
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):
return False
else:
o... |
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_walk(path):
for file_name ... |
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:
return True |
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:
old_flags = []
args = [old_flags, new_flags]
if conf == 'accept_keywords':
tmp = new_f... |
def append_to_package_conf(conf, atom='', flags=None, string='', overwrite=False):
'''
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-admi... |
def append_use_flags(atom, uses=None, overwrite=False):
'''
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/s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.