repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
saltstack/salt
salt/beacons/__init__.py
Beacon._trim_config
def _trim_config(self, b_config, mod, key): ''' Take a beacon configuration and strip out the interval bits ''' if isinstance(b_config[mod], list): self._remove_list_item(b_config[mod], key) elif isinstance(b_config[mod], dict): b_config[mod].pop(key) ...
python
def _trim_config(self, b_config, mod, key): ''' Take a beacon configuration and strip out the interval bits ''' if isinstance(b_config[mod], list): self._remove_list_item(b_config[mod], key) elif isinstance(b_config[mod], dict): b_config[mod].pop(key) ...
[ "def", "_trim_config", "(", "self", ",", "b_config", ",", "mod", ",", "key", ")", ":", "if", "isinstance", "(", "b_config", "[", "mod", "]", ",", "list", ")", ":", "self", ".", "_remove_list_item", "(", "b_config", "[", "mod", "]", ",", "key", ")", ...
Take a beacon configuration and strip out the interval bits
[ "Take", "a", "beacon", "configuration", "and", "strip", "out", "the", "interval", "bits" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L133-L141
train
Take a beacon configuration and strip out the interval bits
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon._determine_beacon_config
def _determine_beacon_config(self, current_beacon_config, key): ''' Process a beacon configuration to determine its interval ''' interval = False if isinstance(current_beacon_config, dict): interval = current_beacon_config.get(key, False) return interval
python
def _determine_beacon_config(self, current_beacon_config, key): ''' Process a beacon configuration to determine its interval ''' interval = False if isinstance(current_beacon_config, dict): interval = current_beacon_config.get(key, False) return interval
[ "def", "_determine_beacon_config", "(", "self", ",", "current_beacon_config", ",", "key", ")", ":", "interval", "=", "False", "if", "isinstance", "(", "current_beacon_config", ",", "dict", ")", ":", "interval", "=", "current_beacon_config", ".", "get", "(", "key...
Process a beacon configuration to determine its interval
[ "Process", "a", "beacon", "configuration", "to", "determine", "its", "interval" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L143-L152
train
Process a beacon configuration to determine its interval
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon._process_interval
def _process_interval(self, mod, interval): ''' Process beacons with intervals Return True if a beacon should be run on this loop ''' log.trace('Processing interval %s for beacon mod %s', interval, mod) loop_interval = self.opts['loop_interval'] if mod in self.int...
python
def _process_interval(self, mod, interval): ''' Process beacons with intervals Return True if a beacon should be run on this loop ''' log.trace('Processing interval %s for beacon mod %s', interval, mod) loop_interval = self.opts['loop_interval'] if mod in self.int...
[ "def", "_process_interval", "(", "self", ",", "mod", ",", "interval", ")", ":", "log", ".", "trace", "(", "'Processing interval %s for beacon mod %s'", ",", "interval", ",", "mod", ")", "loop_interval", "=", "self", ".", "opts", "[", "'loop_interval'", "]", "i...
Process beacons with intervals Return True if a beacon should be run on this loop
[ "Process", "beacons", "with", "intervals", "Return", "True", "if", "a", "beacon", "should", "be", "run", "on", "this", "loop" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L154-L173
train
Process beacons with intervals Return True if a beacon should be run on this loop otherwise Return False
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon._get_index
def _get_index(self, beacon_config, label): ''' Return the index of a labeled config item in the beacon config, -1 if the index is not found ''' indexes = [index for index, item in enumerate(beacon_config) if label in item] if not indexes: return -1 else: ...
python
def _get_index(self, beacon_config, label): ''' Return the index of a labeled config item in the beacon config, -1 if the index is not found ''' indexes = [index for index, item in enumerate(beacon_config) if label in item] if not indexes: return -1 else: ...
[ "def", "_get_index", "(", "self", ",", "beacon_config", ",", "label", ")", ":", "indexes", "=", "[", "index", "for", "index", ",", "item", "in", "enumerate", "(", "beacon_config", ")", "if", "label", "in", "item", "]", "if", "not", "indexes", ":", "ret...
Return the index of a labeled config item in the beacon config, -1 if the index is not found
[ "Return", "the", "index", "of", "a", "labeled", "config", "item", "in", "the", "beacon", "config", "-", "1", "if", "the", "index", "is", "not", "found" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L175-L184
train
Return the index of a labeled config item in the beacon config
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon._remove_list_item
def _remove_list_item(self, beacon_config, label): ''' Remove an item from a beacon config list ''' index = self._get_index(beacon_config, label) del beacon_config[index]
python
def _remove_list_item(self, beacon_config, label): ''' Remove an item from a beacon config list ''' index = self._get_index(beacon_config, label) del beacon_config[index]
[ "def", "_remove_list_item", "(", "self", ",", "beacon_config", ",", "label", ")", ":", "index", "=", "self", ".", "_get_index", "(", "beacon_config", ",", "label", ")", "del", "beacon_config", "[", "index", "]" ]
Remove an item from a beacon config list
[ "Remove", "an", "item", "from", "a", "beacon", "config", "list" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L186-L192
train
Remove an item from a beacon config list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon._update_enabled
def _update_enabled(self, name, enabled_value): ''' Update whether an individual beacon is enabled ''' if isinstance(self.opts['beacons'][name], dict): # Backwards compatibility self.opts['beacons'][name]['enabled'] = enabled_value else: enabl...
python
def _update_enabled(self, name, enabled_value): ''' Update whether an individual beacon is enabled ''' if isinstance(self.opts['beacons'][name], dict): # Backwards compatibility self.opts['beacons'][name]['enabled'] = enabled_value else: enabl...
[ "def", "_update_enabled", "(", "self", ",", "name", ",", "enabled_value", ")", ":", "if", "isinstance", "(", "self", ".", "opts", "[", "'beacons'", "]", "[", "name", "]", ",", "dict", ")", ":", "# Backwards compatibility", "self", ".", "opts", "[", "'bea...
Update whether an individual beacon is enabled
[ "Update", "whether", "an", "individual", "beacon", "is", "enabled" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L194-L207
train
Update whether an individual beacon is enabled
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon._get_beacons
def _get_beacons(self, include_opts=True, include_pillar=True): ''' Return the beacons data structure ''' beacons = {} if include_pillar: pillar_beacons = self.opts.get('pillar', {}).get('beacons', {}) if not isins...
python
def _get_beacons(self, include_opts=True, include_pillar=True): ''' Return the beacons data structure ''' beacons = {} if include_pillar: pillar_beacons = self.opts.get('pillar', {}).get('beacons', {}) if not isins...
[ "def", "_get_beacons", "(", "self", ",", "include_opts", "=", "True", ",", "include_pillar", "=", "True", ")", ":", "beacons", "=", "{", "}", "if", "include_pillar", ":", "pillar_beacons", "=", "self", ".", "opts", ".", "get", "(", "'pillar'", ",", "{", ...
Return the beacons data structure
[ "Return", "the", "beacons", "data", "structure" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L209-L226
train
Return the beacons data structure
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon.list_beacons
def list_beacons(self, include_pillar=True, include_opts=True): ''' List the beacon items include_pillar: Whether to include beacons that are configured in pillar, default is True. include_opts: Whether to include beac...
python
def list_beacons(self, include_pillar=True, include_opts=True): ''' List the beacon items include_pillar: Whether to include beacons that are configured in pillar, default is True. include_opts: Whether to include beac...
[ "def", "list_beacons", "(", "self", ",", "include_pillar", "=", "True", ",", "include_opts", "=", "True", ")", ":", "beacons", "=", "self", ".", "_get_beacons", "(", "include_pillar", ",", "include_opts", ")", "# Fire the complete event back along with the list of bea...
List the beacon items include_pillar: Whether to include beacons that are configured in pillar, default is True. include_opts: Whether to include beacons that are configured in opts, default is True.
[ "List", "the", "beacon", "items" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L228-L247
train
List the beacons in the minion
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon.list_available_beacons
def list_available_beacons(self): ''' List the available beacons ''' _beacons = ['{0}'.format(_beacon.replace('.beacon', '')) for _beacon in self.beacons if '.beacon' in _beacon] # Fire the complete event back along with the list of beacons evt = salt...
python
def list_available_beacons(self): ''' List the available beacons ''' _beacons = ['{0}'.format(_beacon.replace('.beacon', '')) for _beacon in self.beacons if '.beacon' in _beacon] # Fire the complete event back along with the list of beacons evt = salt...
[ "def", "list_available_beacons", "(", "self", ")", ":", "_beacons", "=", "[", "'{0}'", ".", "format", "(", "_beacon", ".", "replace", "(", "'.beacon'", ",", "''", ")", ")", "for", "_beacon", "in", "self", ".", "beacons", "if", "'.beacon'", "in", "_beacon...
List the available beacons
[ "List", "the", "available", "beacons" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L249-L261
train
List the available beacons
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon.validate_beacon
def validate_beacon(self, name, beacon_data): ''' Return available beacon functions ''' validate_str = '{}.validate'.format(name) # Run the validate function if it's available, # otherwise there is a warning about it being missing if validate_str in self.beacons: ...
python
def validate_beacon(self, name, beacon_data): ''' Return available beacon functions ''' validate_str = '{}.validate'.format(name) # Run the validate function if it's available, # otherwise there is a warning about it being missing if validate_str in self.beacons: ...
[ "def", "validate_beacon", "(", "self", ",", "name", ",", "beacon_data", ")", ":", "validate_str", "=", "'{}.validate'", ".", "format", "(", "name", ")", "# Run the validate function if it's available,", "# otherwise there is a warning about it being missing", "if", "validat...
Return available beacon functions
[ "Return", "available", "beacon", "functions" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L263-L286
train
Validate a beacon
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon.add_beacon
def add_beacon(self, name, beacon_data): ''' Add a beacon item ''' data = {} data[name] = beacon_data if name in self._get_beacons(include_opts=False): comment = 'Cannot update beacon item {0}, ' \ 'because it is configured in pillar.'....
python
def add_beacon(self, name, beacon_data): ''' Add a beacon item ''' data = {} data[name] = beacon_data if name in self._get_beacons(include_opts=False): comment = 'Cannot update beacon item {0}, ' \ 'because it is configured in pillar.'....
[ "def", "add_beacon", "(", "self", ",", "name", ",", "beacon_data", ")", ":", "data", "=", "{", "}", "data", "[", "name", "]", "=", "beacon_data", "if", "name", "in", "self", ".", "_get_beacons", "(", "include_opts", "=", "False", ")", ":", "comment", ...
Add a beacon item
[ "Add", "a", "beacon", "item" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L288-L315
train
Add a beacon item to the beacon list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon.delete_beacon
def delete_beacon(self, name): ''' Delete a beacon item ''' if name in self._get_beacons(include_opts=False): comment = 'Cannot delete beacon item {0}, ' \ 'it is configured in pillar.'.format(name) complete = False else: ...
python
def delete_beacon(self, name): ''' Delete a beacon item ''' if name in self._get_beacons(include_opts=False): comment = 'Cannot delete beacon item {0}, ' \ 'it is configured in pillar.'.format(name) complete = False else: ...
[ "def", "delete_beacon", "(", "self", ",", "name", ")", ":", "if", "name", "in", "self", ".", "_get_beacons", "(", "include_opts", "=", "False", ")", ":", "comment", "=", "'Cannot delete beacon item {0}, '", "'it is configured in pillar.'", ".", "format", "(", "n...
Delete a beacon item
[ "Delete", "a", "beacon", "item" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L342-L365
train
Delete a beacon item
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon.enable_beacons
def enable_beacons(self): ''' Enable beacons ''' self.opts['beacons']['enabled'] = True # Fire the complete event back along with updated list of beacons evt = salt.utils.event.get_event('minion', opts=self.opts) evt.fire_event({'complete': True, 'beacons': self...
python
def enable_beacons(self): ''' Enable beacons ''' self.opts['beacons']['enabled'] = True # Fire the complete event back along with updated list of beacons evt = salt.utils.event.get_event('minion', opts=self.opts) evt.fire_event({'complete': True, 'beacons': self...
[ "def", "enable_beacons", "(", "self", ")", ":", "self", ".", "opts", "[", "'beacons'", "]", "[", "'enabled'", "]", "=", "True", "# Fire the complete event back along with updated list of beacons", "evt", "=", "salt", ".", "utils", ".", "event", ".", "get_event", ...
Enable beacons
[ "Enable", "beacons" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L367-L379
train
Enable beacons on the master
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/beacons/__init__.py
Beacon.disable_beacons
def disable_beacons(self): ''' Enable beacons ''' self.opts['beacons']['enabled'] = False # Fire the complete event back along with updated list of beacons evt = salt.utils.event.get_event('minion', opts=self.opts) evt.fire_event({'complete': True, 'beacons': se...
python
def disable_beacons(self): ''' Enable beacons ''' self.opts['beacons']['enabled'] = False # Fire the complete event back along with updated list of beacons evt = salt.utils.event.get_event('minion', opts=self.opts) evt.fire_event({'complete': True, 'beacons': se...
[ "def", "disable_beacons", "(", "self", ")", ":", "self", ".", "opts", "[", "'beacons'", "]", "[", "'enabled'", "]", "=", "False", "# Fire the complete event back along with updated list of beacons", "evt", "=", "salt", ".", "utils", ".", "event", ".", "get_event",...
Enable beacons
[ "Enable", "beacons" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/__init__.py#L381-L393
train
Disable the beacons on this minion
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/macpackage.py
install
def install(pkg, target='LocalSystem', store=False, allow_untrusted=False): ''' Install a pkg file Args: pkg (str): The package to install target (str): The target in which to install the package to store (bool): Should the package be installed as if it was from the ...
python
def install(pkg, target='LocalSystem', store=False, allow_untrusted=False): ''' Install a pkg file Args: pkg (str): The package to install target (str): The target in which to install the package to store (bool): Should the package be installed as if it was from the ...
[ "def", "install", "(", "pkg", ",", "target", "=", "'LocalSystem'", ",", "store", "=", "False", ",", "allow_untrusted", "=", "False", ")", ":", "if", "'*.'", "not", "in", "pkg", ":", "# If we use wildcards, we cannot use quotes", "pkg", "=", "_quote", "(", "p...
Install a pkg file Args: pkg (str): The package to install target (str): The target in which to install the package to store (bool): Should the package be installed as if it was from the store? allow_untrusted (bool): Allow the installation of untrusted package...
[ "Install", "a", "pkg", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/macpackage.py#L43-L81
train
Install a pkg file to the specified target
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/macpackage.py
install_app
def install_app(app, target='/Applications/'): ''' Install an app file by moving it into the specified Applications directory Args: app (str): The location of the .app file target (str): The target in which to install the package to Default is ''/Applications/'' R...
python
def install_app(app, target='/Applications/'): ''' Install an app file by moving it into the specified Applications directory Args: app (str): The location of the .app file target (str): The target in which to install the package to Default is ''/Applications/'' R...
[ "def", "install_app", "(", "app", ",", "target", "=", "'/Applications/'", ")", ":", "if", "target", "[", "-", "4", ":", "]", "!=", "'.app'", ":", "if", "app", "[", "-", "1", ":", "]", "==", "'/'", ":", "base_app", "=", "os", ".", "path", ".", "...
Install an app file by moving it into the specified Applications directory Args: app (str): The location of the .app file target (str): The target in which to install the package to Default is ''/Applications/'' Returns: str: The results of the rsync command ...
[ "Install", "an", "app", "file", "by", "moving", "it", "into", "the", "specified", "Applications", "directory" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/macpackage.py#L84-L115
train
Install an app file by moving it into the specified Applications directory
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/macpackage.py
mount
def mount(dmg): ''' Attempt to mount a dmg file to a temporary location and return the location of the pkg file inside Args: dmg (str): The location of the dmg file to mount Returns: tuple: Tuple containing the results of the command along with the mount point C...
python
def mount(dmg): ''' Attempt to mount a dmg file to a temporary location and return the location of the pkg file inside Args: dmg (str): The location of the dmg file to mount Returns: tuple: Tuple containing the results of the command along with the mount point C...
[ "def", "mount", "(", "dmg", ")", ":", "temp_dir", "=", "__salt__", "[", "'temp.dir'", "]", "(", "prefix", "=", "'dmg-'", ")", "cmd", "=", "'hdiutil attach -readonly -nobrowse -mountpoint {0} \"{1}\"'", ".", "format", "(", "temp_dir", ",", "dmg", ")", "return", ...
Attempt to mount a dmg file to a temporary location and return the location of the pkg file inside Args: dmg (str): The location of the dmg file to mount Returns: tuple: Tuple containing the results of the command along with the mount point CLI Example: .. code-blo...
[ "Attempt", "to", "mount", "a", "dmg", "file", "to", "a", "temporary", "location", "and", "return", "the", "location", "of", "the", "pkg", "file", "inside" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/macpackage.py#L138-L161
train
Mount a dmg file to a temporary location and return the location of the pkg file inside the
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/macpackage.py
get_pkg_id
def get_pkg_id(pkg): ''' Attempt to get the package ID from a .pkg file Args: pkg (str): The location of the pkg file Returns: list: List of all of the package IDs CLI Example: .. code-block:: bash salt '*' macpackage.get_pkg_id /tmp/test.pkg ''' pkg = _quote...
python
def get_pkg_id(pkg): ''' Attempt to get the package ID from a .pkg file Args: pkg (str): The location of the pkg file Returns: list: List of all of the package IDs CLI Example: .. code-block:: bash salt '*' macpackage.get_pkg_id /tmp/test.pkg ''' pkg = _quote...
[ "def", "get_pkg_id", "(", "pkg", ")", ":", "pkg", "=", "_quote", "(", "pkg", ")", "package_ids", "=", "[", "]", "# Create temp directory", "temp_dir", "=", "__salt__", "[", "'temp.dir'", "]", "(", "prefix", "=", "'pkg-'", ")", "try", ":", "# List all of th...
Attempt to get the package ID from a .pkg file Args: pkg (str): The location of the pkg file Returns: list: List of all of the package IDs CLI Example: .. code-block:: bash salt '*' macpackage.get_pkg_id /tmp/test.pkg
[ "Attempt", "to", "get", "the", "package", "ID", "from", "a", ".", "pkg", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/macpackage.py#L205-L250
train
Get the package ID from a. pkg file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/macpackage.py
get_mpkg_ids
def get_mpkg_ids(mpkg): ''' Attempt to get the package IDs from a mounted .mpkg file Args: mpkg (str): The location of the mounted mpkg file Returns: list: List of package IDs CLI Example: .. code-block:: bash salt '*' macpackage.get_mpkg_ids /dev/disk2 ''' m...
python
def get_mpkg_ids(mpkg): ''' Attempt to get the package IDs from a mounted .mpkg file Args: mpkg (str): The location of the mounted mpkg file Returns: list: List of package IDs CLI Example: .. code-block:: bash salt '*' macpackage.get_mpkg_ids /dev/disk2 ''' m...
[ "def", "get_mpkg_ids", "(", "mpkg", ")", ":", "mpkg", "=", "_quote", "(", "mpkg", ")", "package_infos", "=", "[", "]", "base_path", "=", "os", ".", "path", ".", "dirname", "(", "mpkg", ")", "# List all of the .pkg files", "cmd", "=", "'find {0} -name *.pkg'"...
Attempt to get the package IDs from a mounted .mpkg file Args: mpkg (str): The location of the mounted mpkg file Returns: list: List of package IDs CLI Example: .. code-block:: bash salt '*' macpackage.get_mpkg_ids /dev/disk2
[ "Attempt", "to", "get", "the", "package", "IDs", "from", "a", "mounted", ".", "mpkg", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/macpackage.py#L253-L281
train
Get the package IDs from a mounted. mpkg file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/apkpkg.py
refresh_db
def refresh_db(**kwargs): ''' Updates the package list - ``True``: Database updated successfully - ``False``: Problem updating database CLI Example: .. code-block:: bash salt '*' pkg.refresh_db ''' ret = {} cmd = ['apk', 'update'] call = __salt__['cmd.run_all'](cmd, ...
python
def refresh_db(**kwargs): ''' Updates the package list - ``True``: Database updated successfully - ``False``: Problem updating database CLI Example: .. code-block:: bash salt '*' pkg.refresh_db ''' ret = {} cmd = ['apk', 'update'] call = __salt__['cmd.run_all'](cmd, ...
[ "def", "refresh_db", "(", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'apk'", ",", "'update'", "]", "call", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "output_loglevel", "=", "'trace'", ",", "python_shell", ...
Updates the package list - ``True``: Database updated successfully - ``False``: Problem updating database CLI Example: .. code-block:: bash salt '*' pkg.refresh_db
[ "Updates", "the", "package", "list" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apkpkg.py#L86-L117
train
Updates the database with the current version of the package list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/apkpkg.py
list_pkgs
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed in a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs salt '*' pkg.list_pkgs versions_as_list=True ''' versions_as_list = salt.uti...
python
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed in a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs salt '*' pkg.list_pkgs versions_as_list=True ''' versions_as_list = salt.uti...
[ "def", "list_pkgs", "(", "versions_as_list", "=", "False", ",", "*", "*", "kwargs", ")", ":", "versions_as_list", "=", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "versions_as_list", ")", "# not yet implemented or not applicable", "if", "any", "(", ...
List the packages currently installed in a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs salt '*' pkg.list_pkgs versions_as_list=True
[ "List", "the", "packages", "currently", "installed", "in", "a", "dict", "::" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apkpkg.py#L120-L159
train
List the packages currently installed in a dict
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/apkpkg.py
install
def install(name=None, refresh=False, pkgs=None, sources=None, **kwargs): ''' Install the passed package, add refresh=True to update the apk database. name The name of the package to be installed. Note that this parameter is ignored if either ...
python
def install(name=None, refresh=False, pkgs=None, sources=None, **kwargs): ''' Install the passed package, add refresh=True to update the apk database. name The name of the package to be installed. Note that this parameter is ignored if either ...
[ "def", "install", "(", "name", "=", "None", ",", "refresh", "=", "False", ",", "pkgs", "=", "None", ",", "sources", "=", "None", ",", "*", "*", "kwargs", ")", ":", "refreshdb", "=", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "refresh",...
Install the passed package, add refresh=True to update the apk database. name The name of the package to be installed. Note that this parameter is ignored if either "pkgs" or "sources" is passed. Additionally, please note that this option can only be used to install packages from a ...
[ "Install", "the", "passed", "package", "add", "refresh", "=", "True", "to", "update", "the", "apk", "database", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apkpkg.py#L235-L349
train
Installs the passed IPK package file from the software repository.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/apkpkg.py
remove
def remove(name=None, pkgs=None, purge=False, **kwargs): # pylint: disable=unused-argument ''' Remove packages using ``apk del``. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ...
python
def remove(name=None, pkgs=None, purge=False, **kwargs): # pylint: disable=unused-argument ''' Remove packages using ``apk del``. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ...
[ "def", "remove", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "purge", "=", "False", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "old", "=", "list_pkgs", "(", ")", "pkg_to_remove", "=", "[", "]", "if", "name", ":...
Remove packages using ``apk del``. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option is passed. Returns a dict containing the changes...
[ "Remove", "packages", "using", "apk", "del", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apkpkg.py#L359-L425
train
Remove packages from the available packages.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/apkpkg.py
upgrade
def upgrade(name=None, pkgs=None, refresh=True, **kwargs): ''' Upgrades all packages via ``apk upgrade`` or a specific package if name or pkgs is specified. Name is ignored if pkgs is specified Returns a dict containing the changes. {'<package>': {'old': '<old-version>', ...
python
def upgrade(name=None, pkgs=None, refresh=True, **kwargs): ''' Upgrades all packages via ``apk upgrade`` or a specific package if name or pkgs is specified. Name is ignored if pkgs is specified Returns a dict containing the changes. {'<package>': {'old': '<old-version>', ...
[ "def", "upgrade", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "refresh", "=", "True", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "...
Upgrades all packages via ``apk upgrade`` or a specific package if name or pkgs is specified. Name is ignored if pkgs is specified Returns a dict containing the changes. {'<package>': {'old': '<old-version>', 'new': '<new-version>'}} CLI Example: .. code-block:: bash...
[ "Upgrades", "all", "packages", "via", "apk", "upgrade", "or", "a", "specific", "package", "if", "name", "or", "pkgs", "is", "specified", ".", "Name", "is", "ignored", "if", "pkgs", "is", "specified" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apkpkg.py#L428-L485
train
Upgrade all packages via apk upgrade or a specific package
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/apkpkg.py
file_dict
def file_dict(*packages, **kwargs): ''' List the files that belong to a package, grouped by package. Not specifying any packages will return a list of _every_ file on the system's package database (not generally recommended). CLI Examples: .. code-block:: bash salt '*' pkg.file_list h...
python
def file_dict(*packages, **kwargs): ''' List the files that belong to a package, grouped by package. Not specifying any packages will return a list of _every_ file on the system's package database (not generally recommended). CLI Examples: .. code-block:: bash salt '*' pkg.file_list h...
[ "def", "file_dict", "(", "*", "packages", ",", "*", "*", "kwargs", ")", ":", "errors", "=", "[", "]", "ret", "=", "{", "}", "cmd_files", "=", "[", "'apk'", ",", "'info'", ",", "'-L'", "]", "if", "not", "packages", ":", "return", "'Package name should...
List the files that belong to a package, grouped by package. Not specifying any packages will return a list of _every_ file on the system's package database (not generally recommended). CLI Examples: .. code-block:: bash salt '*' pkg.file_list httpd salt '*' pkg.file_list httpd postfi...
[ "List", "the", "files", "that", "belong", "to", "a", "package", "grouped", "by", "package", ".", "Not", "specifying", "any", "packages", "will", "return", "a", "list", "of", "_every_", "file", "on", "the", "system", "s", "package", "database", "(", "not", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apkpkg.py#L544-L580
train
Return a dict of all files in a set of packages grouped by package.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/apkpkg.py
owner
def owner(*paths, **kwargs): ''' Return the name of the package that owns the file. Multiple file paths can be passed. Like :mod:`pkg.version <salt.modules.apk.version`, if a single path is passed, a string will be returned, and if multiple paths are passed, a dictionary of file/package name pairs w...
python
def owner(*paths, **kwargs): ''' Return the name of the package that owns the file. Multiple file paths can be passed. Like :mod:`pkg.version <salt.modules.apk.version`, if a single path is passed, a string will be returned, and if multiple paths are passed, a dictionary of file/package name pairs w...
[ "def", "owner", "(", "*", "paths", ",", "*", "*", "kwargs", ")", ":", "if", "not", "paths", ":", "return", "'You must provide a path'", "ret", "=", "{", "}", "cmd_search", "=", "[", "'apk'", ",", "'info'", ",", "'-W'", "]", "for", "path", "in", "path...
Return the name of the package that owns the file. Multiple file paths can be passed. Like :mod:`pkg.version <salt.modules.apk.version`, if a single path is passed, a string will be returned, and if multiple paths are passed, a dictionary of file/package name pairs will be returned. If the file is not ...
[ "Return", "the", "name", "of", "the", "package", "that", "owns", "the", "file", ".", "Multiple", "file", "paths", "can", "be", "passed", ".", "Like", ":", "mod", ":", "pkg", ".", "version", "<salt", ".", "modules", ".", "apk", ".", "version", "if", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/apkpkg.py#L583-L617
train
Return the name of the package that owns the file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/ini_manage.py
options_present
def options_present(name, sections=None, separator='=', strict=False): ''' .. code-block:: yaml /home/saltminion/api-paste.ini: ini.options_present: - separator: '=' - strict: True - sections: test: testkey: 'testval' ...
python
def options_present(name, sections=None, separator='=', strict=False): ''' .. code-block:: yaml /home/saltminion/api-paste.ini: ini.options_present: - separator: '=' - strict: True - sections: test: testkey: 'testval' ...
[ "def", "options_present", "(", "name", ",", "sections", "=", "None", ",", "separator", "=", "'='", ",", "strict", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'...
.. code-block:: yaml /home/saltminion/api-paste.ini: ini.options_present: - separator: '=' - strict: True - sections: test: testkey: 'testval' secondoption: 'secondvalue' test1: t...
[ "..", "code", "-", "block", "::", "yaml" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ini_manage.py#L30-L143
train
Ensures that the options present in file are present in sections and if strict is True the options are not present in file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/ini_manage.py
options_absent
def options_absent(name, sections=None, separator='='): ''' .. code-block:: yaml /home/saltminion/api-paste.ini: ini.options_absent: - separator: '=' - sections: test: - testkey - secondoption test1: ...
python
def options_absent(name, sections=None, separator='='): ''' .. code-block:: yaml /home/saltminion/api-paste.ini: ini.options_absent: - separator: '=' - sections: test: - testkey - secondoption test1: ...
[ "def", "options_absent", "(", "name", ",", "sections", "=", "None", ",", "separator", "=", "'='", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'No anomaly detec...
.. code-block:: yaml /home/saltminion/api-paste.ini: ini.options_absent: - separator: '=' - sections: test: - testkey - secondoption test1: - testkey1 options present in file and not spe...
[ "..", "code", "-", "block", "::", "yaml" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ini_manage.py#L146-L220
train
Ensures that the specified option is absent in the specified section.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/ini_manage.py
sections_present
def sections_present(name, sections=None, separator='='): ''' .. code-block:: yaml /home/saltminion/api-paste.ini: ini.sections_present: - separator: '=' - sections: - section_one - section_two This will only create empty sections. ...
python
def sections_present(name, sections=None, separator='='): ''' .. code-block:: yaml /home/saltminion/api-paste.ini: ini.sections_present: - separator: '=' - sections: - section_one - section_two This will only create empty sections. ...
[ "def", "sections_present", "(", "name", ",", "sections", "=", "None", ",", "separator", "=", "'='", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'No anomaly det...
.. code-block:: yaml /home/saltminion/api-paste.ini: ini.sections_present: - separator: '=' - sections: - section_one - section_two This will only create empty sections. To also create options, use options_present state options pre...
[ "..", "code", "-", "block", "::", "yaml" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ini_manage.py#L223-L279
train
Ensure that the section is present in the ini file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/ini_manage.py
sections_absent
def sections_absent(name, sections=None, separator='='): ''' .. code-block:: yaml /home/saltminion/api-paste.ini: ini.sections_absent: - separator: '=' - sections: - test - test1 options present in file and not specified in sections...
python
def sections_absent(name, sections=None, separator='='): ''' .. code-block:: yaml /home/saltminion/api-paste.ini: ini.sections_absent: - separator: '=' - sections: - test - test1 options present in file and not specified in sections...
[ "def", "sections_absent", "(", "name", ",", "sections", "=", "None", ",", "separator", "=", "'='", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'No anomaly dete...
.. code-block:: yaml /home/saltminion/api-paste.ini: ini.sections_absent: - separator: '=' - sections: - test - test1 options present in file and not specified in sections will be deleted changes dict will contain the sections that chan...
[ "..", "code", "-", "block", "::", "yaml" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ini_manage.py#L282-L330
train
Ensures that the section in ini file is absent in the specified sections.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/pam.py
_parse
def _parse(contents=None, file_name=None): ''' Parse a standard pam config file ''' if contents: pass elif file_name and os.path.exists(file_name): with salt.utils.files.fopen(file_name, 'r') as ifile: contents = salt.utils.stringutils.to_unicode(ifile.read()) else: ...
python
def _parse(contents=None, file_name=None): ''' Parse a standard pam config file ''' if contents: pass elif file_name and os.path.exists(file_name): with salt.utils.files.fopen(file_name, 'r') as ifile: contents = salt.utils.stringutils.to_unicode(ifile.read()) else: ...
[ "def", "_parse", "(", "contents", "=", "None", ",", "file_name", "=", "None", ")", ":", "if", "contents", ":", "pass", "elif", "file_name", "and", "os", ".", "path", ".", "exists", "(", "file_name", ")", ":", "with", "salt", ".", "utils", ".", "files...
Parse a standard pam config file
[ "Parse", "a", "standard", "pam", "config", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pam.py#L27-L73
train
Parse a standard pam config file and return a list of dictionaries
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
__get_request_auth
def __get_request_auth(username, password): ''' Get libvirt.openAuth callback with username, password values overriding the configuration ones. ''' # pylint: disable=unused-argument def __request_auth(credentials, user_data): '''Callback method passed to libvirt.openAuth(). The...
python
def __get_request_auth(username, password): ''' Get libvirt.openAuth callback with username, password values overriding the configuration ones. ''' # pylint: disable=unused-argument def __request_auth(credentials, user_data): '''Callback method passed to libvirt.openAuth(). The...
[ "def", "__get_request_auth", "(", "username", ",", "password", ")", ":", "# pylint: disable=unused-argument", "def", "__request_auth", "(", "credentials", ",", "user_data", ")", ":", "'''Callback method passed to libvirt.openAuth().\n\n The credentials argument is a list of ...
Get libvirt.openAuth callback with username, password values overriding the configuration ones.
[ "Get", "libvirt", ".", "openAuth", "callback", "with", "username", "password", "values", "overriding", "the", "configuration", "ones", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L137-L167
train
Return a callback that returns a function that will be called when the user requests the user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
__get_conn
def __get_conn(**kwargs): ''' Detects what type of dom this node is and attempts to connect to the correct hypervisor via libvirt. :param connection: libvirt connection URI, overriding defaults :param username: username to connect with, overriding defaults :param password: password to connect w...
python
def __get_conn(**kwargs): ''' Detects what type of dom this node is and attempts to connect to the correct hypervisor via libvirt. :param connection: libvirt connection URI, overriding defaults :param username: username to connect with, overriding defaults :param password: password to connect w...
[ "def", "__get_conn", "(", "*", "*", "kwargs", ")", ":", "# This has only been tested on kvm and xen, it needs to be expanded to", "# support all vm layers supported by libvirt", "# Connection string works on bhyve, but auth is not tested.", "username", "=", "kwargs", ".", "get", "(",...
Detects what type of dom this node is and attempts to connect to the correct hypervisor via libvirt. :param connection: libvirt connection URI, overriding defaults :param username: username to connect with, overriding defaults :param password: password to connect with, overriding defaults
[ "Detects", "what", "type", "of", "dom", "this", "node", "is", "and", "attempts", "to", "connect", "to", "the", "correct", "hypervisor", "via", "libvirt", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L170-L243
train
Returns the libvirt connection string for the node
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_get_domain
def _get_domain(conn, *vms, **kwargs): ''' Return a domain object for the named VM or return domain object for all VMs. :params conn: libvirt connection object :param vms: list of domain names to look for :param iterable: True to return an array in all cases ''' ret = list() lookup_vms ...
python
def _get_domain(conn, *vms, **kwargs): ''' Return a domain object for the named VM or return domain object for all VMs. :params conn: libvirt connection object :param vms: list of domain names to look for :param iterable: True to return an array in all cases ''' ret = list() lookup_vms ...
[ "def", "_get_domain", "(", "conn", ",", "*", "vms", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "list", "(", ")", "lookup_vms", "=", "list", "(", ")", "all_vms", "=", "[", "]", "if", "kwargs", ".", "get", "(", "'active'", ",", "True", ")", "...
Return a domain object for the named VM or return domain object for all VMs. :params conn: libvirt connection object :param vms: list of domain names to look for :param iterable: True to return an array in all cases
[ "Return", "a", "domain", "object", "for", "the", "named", "VM", "or", "return", "domain", "object", "for", "all", "VMs", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L246-L281
train
Returns a domain object for the named VM or return all VMs.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_parse_qemu_img_info
def _parse_qemu_img_info(info): ''' Parse qemu-img info JSON output into disk infos dictionary ''' raw_infos = salt.utils.json.loads(info) disks = [] for disk_infos in raw_infos: disk = { 'file': disk_infos['filename'], 'file format': disk_infos['for...
python
def _parse_qemu_img_info(info): ''' Parse qemu-img info JSON output into disk infos dictionary ''' raw_infos = salt.utils.json.loads(info) disks = [] for disk_infos in raw_infos: disk = { 'file': disk_infos['filename'], 'file format': disk_infos['for...
[ "def", "_parse_qemu_img_info", "(", "info", ")", ":", "raw_infos", "=", "salt", ".", "utils", ".", "json", ".", "loads", "(", "info", ")", "disks", "=", "[", "]", "for", "disk_infos", "in", "raw_infos", ":", "disk", "=", "{", "'file'", ":", "disk_infos...
Parse qemu-img info JSON output into disk infos dictionary
[ "Parse", "qemu", "-", "img", "info", "JSON", "output", "into", "disk", "infos", "dictionary" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L284-L322
train
Parse qemu - img info JSON output into a single dictionary
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_get_on_poweroff
def _get_on_poweroff(dom): ''' Return `on_poweroff` setting from the named vm CLI Example: .. code-block:: bash salt '*' virt.get_on_restart <domain> ''' node = ElementTree.fromstring(get_xml(dom)).find('on_poweroff') return node.text if node is not None else ''
python
def _get_on_poweroff(dom): ''' Return `on_poweroff` setting from the named vm CLI Example: .. code-block:: bash salt '*' virt.get_on_restart <domain> ''' node = ElementTree.fromstring(get_xml(dom)).find('on_poweroff') return node.text if node is not None else ''
[ "def", "_get_on_poweroff", "(", "dom", ")", ":", "node", "=", "ElementTree", ".", "fromstring", "(", "get_xml", "(", "dom", ")", ")", ".", "find", "(", "'on_poweroff'", ")", "return", "node", ".", "text", "if", "node", "is", "not", "None", "else", "''"...
Return `on_poweroff` setting from the named vm CLI Example: .. code-block:: bash salt '*' virt.get_on_restart <domain>
[ "Return", "on_poweroff", "setting", "from", "the", "named", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L338-L349
train
Get on_poweroff setting from the named vm CLI Example : bash salt '*' virt. get_on_restart <domain >
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_get_on_reboot
def _get_on_reboot(dom): ''' Return `on_reboot` setting from the named vm CLI Example: .. code-block:: bash salt '*' virt.get_on_reboot <domain> ''' node = ElementTree.fromstring(get_xml(dom)).find('on_reboot') return node.text if node is not None else ''
python
def _get_on_reboot(dom): ''' Return `on_reboot` setting from the named vm CLI Example: .. code-block:: bash salt '*' virt.get_on_reboot <domain> ''' node = ElementTree.fromstring(get_xml(dom)).find('on_reboot') return node.text if node is not None else ''
[ "def", "_get_on_reboot", "(", "dom", ")", ":", "node", "=", "ElementTree", ".", "fromstring", "(", "get_xml", "(", "dom", ")", ")", ".", "find", "(", "'on_reboot'", ")", "return", "node", ".", "text", "if", "node", "is", "not", "None", "else", "''" ]
Return `on_reboot` setting from the named vm CLI Example: .. code-block:: bash salt '*' virt.get_on_reboot <domain>
[ "Return", "on_reboot", "setting", "from", "the", "named", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L352-L363
train
Return on_reboot setting from the named vm CLI Example : bash salt '*' virt. get_on_reboot <domain >
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_get_on_crash
def _get_on_crash(dom): ''' Return `on_crash` setting from the named vm CLI Example: .. code-block:: bash salt '*' virt.get_on_crash <domain> ''' node = ElementTree.fromstring(get_xml(dom)).find('on_crash') return node.text if node is not None else ''
python
def _get_on_crash(dom): ''' Return `on_crash` setting from the named vm CLI Example: .. code-block:: bash salt '*' virt.get_on_crash <domain> ''' node = ElementTree.fromstring(get_xml(dom)).find('on_crash') return node.text if node is not None else ''
[ "def", "_get_on_crash", "(", "dom", ")", ":", "node", "=", "ElementTree", ".", "fromstring", "(", "get_xml", "(", "dom", ")", ")", ".", "find", "(", "'on_crash'", ")", "return", "node", ".", "text", "if", "node", "is", "not", "None", "else", "''" ]
Return `on_crash` setting from the named vm CLI Example: .. code-block:: bash salt '*' virt.get_on_crash <domain>
[ "Return", "on_crash", "setting", "from", "the", "named", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L366-L377
train
Get on_crash setting from the named vm CLI Example : bash salt '*' virt. get_on_crash <domain >
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_get_nics
def _get_nics(dom): ''' Get domain network interfaces from a libvirt domain object. ''' nics = {} doc = ElementTree.fromstring(dom.XMLDesc(0)) for iface_node in doc.findall('devices/interface'): nic = {} nic['type'] = iface_node.get('type') for v_node in iface_node: ...
python
def _get_nics(dom): ''' Get domain network interfaces from a libvirt domain object. ''' nics = {} doc = ElementTree.fromstring(dom.XMLDesc(0)) for iface_node in doc.findall('devices/interface'): nic = {} nic['type'] = iface_node.get('type') for v_node in iface_node: ...
[ "def", "_get_nics", "(", "dom", ")", ":", "nics", "=", "{", "}", "doc", "=", "ElementTree", ".", "fromstring", "(", "dom", ".", "XMLDesc", "(", "0", ")", ")", "for", "iface_node", "in", "doc", ".", "findall", "(", "'devices/interface'", ")", ":", "ni...
Get domain network interfaces from a libvirt domain object.
[ "Get", "domain", "network", "interfaces", "from", "a", "libvirt", "domain", "object", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L380-L413
train
Get domain network interfaces from a libvirt domain object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_get_graphics
def _get_graphics(dom): ''' Get domain graphics from a libvirt domain object. ''' out = {'autoport': 'None', 'keymap': 'None', 'listen': 'None', 'port': 'None', 'type': 'None'} doc = ElementTree.fromstring(dom.XMLDesc(0)) for g_node in doc.findall('dev...
python
def _get_graphics(dom): ''' Get domain graphics from a libvirt domain object. ''' out = {'autoport': 'None', 'keymap': 'None', 'listen': 'None', 'port': 'None', 'type': 'None'} doc = ElementTree.fromstring(dom.XMLDesc(0)) for g_node in doc.findall('dev...
[ "def", "_get_graphics", "(", "dom", ")", ":", "out", "=", "{", "'autoport'", ":", "'None'", ",", "'keymap'", ":", "'None'", ",", "'listen'", ":", "'None'", ",", "'port'", ":", "'None'", ",", "'type'", ":", "'None'", "}", "doc", "=", "ElementTree", ".",...
Get domain graphics from a libvirt domain object.
[ "Get", "domain", "graphics", "from", "a", "libvirt", "domain", "object", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L416-L429
train
Get domain graphics from a libvirt domain object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_get_disks
def _get_disks(dom): ''' Get domain disks from a libvirt domain object. ''' disks = {} doc = ElementTree.fromstring(dom.XMLDesc(0)) for elem in doc.findall('devices/disk'): source = elem.find('source') if source is None: continue target = elem.find('target') ...
python
def _get_disks(dom): ''' Get domain disks from a libvirt domain object. ''' disks = {} doc = ElementTree.fromstring(dom.XMLDesc(0)) for elem in doc.findall('devices/disk'): source = elem.find('source') if source is None: continue target = elem.find('target') ...
[ "def", "_get_disks", "(", "dom", ")", ":", "disks", "=", "{", "}", "doc", "=", "ElementTree", ".", "fromstring", "(", "dom", ".", "XMLDesc", "(", "0", ")", ")", "for", "elem", "in", "doc", ".", "findall", "(", "'devices/disk'", ")", ":", "source", ...
Get domain disks from a libvirt domain object.
[ "Get", "domain", "disks", "from", "a", "libvirt", "domain", "object", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L445-L490
train
Get domain disks from libvirt domain object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_libvirt_creds
def _libvirt_creds(): ''' Returns the user and group that the disk images should be owned by ''' g_cmd = 'grep ^\\s*group /etc/libvirt/qemu.conf' u_cmd = 'grep ^\\s*user /etc/libvirt/qemu.conf' try: stdout = subprocess.Popen(g_cmd, shell=True, ...
python
def _libvirt_creds(): ''' Returns the user and group that the disk images should be owned by ''' g_cmd = 'grep ^\\s*group /etc/libvirt/qemu.conf' u_cmd = 'grep ^\\s*user /etc/libvirt/qemu.conf' try: stdout = subprocess.Popen(g_cmd, shell=True, ...
[ "def", "_libvirt_creds", "(", ")", ":", "g_cmd", "=", "'grep ^\\\\s*group /etc/libvirt/qemu.conf'", "u_cmd", "=", "'grep ^\\\\s*user /etc/libvirt/qemu.conf'", "try", ":", "stdout", "=", "subprocess", ".", "Popen", "(", "g_cmd", ",", "shell", "=", "True", ",", "stdou...
Returns the user and group that the disk images should be owned by
[ "Returns", "the", "user", "and", "group", "that", "the", "disk", "images", "should", "be", "owned", "by" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L493-L513
train
Returns the user and group that the disk images should be owned by Returns the user and group that the disk images should be owned by Returns the user and group that the disk images should be owned by Returns the user group
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_get_migrate_command
def _get_migrate_command(): ''' Returns the command shared by the different migration types ''' tunnel = __salt__['config.option']('virt.tunnel') if tunnel: salt.utils.versions.warn_until( 'Sodium', '\'virt.tunnel\' has been deprecated in favor of ' '\'vir...
python
def _get_migrate_command(): ''' Returns the command shared by the different migration types ''' tunnel = __salt__['config.option']('virt.tunnel') if tunnel: salt.utils.versions.warn_until( 'Sodium', '\'virt.tunnel\' has been deprecated in favor of ' '\'vir...
[ "def", "_get_migrate_command", "(", ")", ":", "tunnel", "=", "__salt__", "[", "'config.option'", "]", "(", "'virt.tunnel'", ")", "if", "tunnel", ":", "salt", ".", "utils", ".", "versions", ".", "warn_until", "(", "'Sodium'", ",", "'\\'virt.tunnel\\' has been dep...
Returns the command shared by the different migration types
[ "Returns", "the", "command", "shared", "by", "the", "different", "migration", "types" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L516-L532
train
Returns the command to be used to migrate the current version of the current migration types.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_gen_xml
def _gen_xml(name, cpu, mem, diskp, nicp, hypervisor, os_type, arch, graphics=None, loader=None, **kwargs): ''' Generate the XML string to define a libvirt VM ''' mem = int(m...
python
def _gen_xml(name, cpu, mem, diskp, nicp, hypervisor, os_type, arch, graphics=None, loader=None, **kwargs): ''' Generate the XML string to define a libvirt VM ''' mem = int(m...
[ "def", "_gen_xml", "(", "name", ",", "cpu", ",", "mem", ",", "diskp", ",", "nicp", ",", "hypervisor", ",", "os_type", ",", "arch", ",", "graphics", "=", "None", ",", "loader", "=", "None", ",", "*", "*", "kwargs", ")", ":", "mem", "=", "int", "("...
Generate the XML string to define a libvirt VM
[ "Generate", "the", "XML", "string", "to", "define", "a", "libvirt", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L545-L656
train
Generate the XML string to define a libvirt VM.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_gen_vol_xml
def _gen_vol_xml(vmname, diskname, disktype, size, pool): ''' Generate the XML string to define a libvirt storage volume ''' size = int(size) * 1024 # MB context = { 'name': vmname, 'filename': '{0}.{1}'.format(disk...
python
def _gen_vol_xml(vmname, diskname, disktype, size, pool): ''' Generate the XML string to define a libvirt storage volume ''' size = int(size) * 1024 # MB context = { 'name': vmname, 'filename': '{0}.{1}'.format(disk...
[ "def", "_gen_vol_xml", "(", "vmname", ",", "diskname", ",", "disktype", ",", "size", ",", "pool", ")", ":", "size", "=", "int", "(", "size", ")", "*", "1024", "# MB", "context", "=", "{", "'name'", ":", "vmname", ",", "'filename'", ":", "'{0}.{1}'", ...
Generate the XML string to define a libvirt storage volume
[ "Generate", "the", "XML", "string", "to", "define", "a", "libvirt", "storage", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L659-L682
train
Generate the XML string to define a libvirt storage volume
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_gen_net_xml
def _gen_net_xml(name, bridge, forward, vport, tag=None): ''' Generate the XML string to define a libvirt network ''' context = { 'name': name, 'bridge': bridge, 'forward': forward, 'vport': vport, ...
python
def _gen_net_xml(name, bridge, forward, vport, tag=None): ''' Generate the XML string to define a libvirt network ''' context = { 'name': name, 'bridge': bridge, 'forward': forward, 'vport': vport, ...
[ "def", "_gen_net_xml", "(", "name", ",", "bridge", ",", "forward", ",", "vport", ",", "tag", "=", "None", ")", ":", "context", "=", "{", "'name'", ":", "name", ",", "'bridge'", ":", "bridge", ",", "'forward'", ":", "forward", ",", "'vport'", ":", "vp...
Generate the XML string to define a libvirt network
[ "Generate", "the", "XML", "string", "to", "define", "a", "libvirt", "network" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L685-L706
train
Generate the XML string to define a libvirt network
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_gen_pool_xml
def _gen_pool_xml(name, ptype, target=None, permissions=None, source_devices=None, source_dir=None, source_adapter=None, source_hosts=None, source_auth=None, ...
python
def _gen_pool_xml(name, ptype, target=None, permissions=None, source_devices=None, source_dir=None, source_adapter=None, source_hosts=None, source_auth=None, ...
[ "def", "_gen_pool_xml", "(", "name", ",", "ptype", ",", "target", "=", "None", ",", "permissions", "=", "None", ",", "source_devices", "=", "None", ",", "source_dir", "=", "None", ",", "source_adapter", "=", "None", ",", "source_hosts", "=", "None", ",", ...
Generate the XML string to define a libvirt storage pool
[ "Generate", "the", "XML", "string", "to", "define", "a", "libvirt", "storage", "pool" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L709-L744
train
Generate the XML string to define a libvirt storage pool
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_get_images_dir
def _get_images_dir(): ''' Extract the images dir from the configuration. First attempts to find legacy virt.images, then tries virt:images. ''' img_dir = __salt__['config.option']('virt.images') if img_dir: salt.utils.versions.warn_until( 'Sodium', '\'virt.images...
python
def _get_images_dir(): ''' Extract the images dir from the configuration. First attempts to find legacy virt.images, then tries virt:images. ''' img_dir = __salt__['config.option']('virt.images') if img_dir: salt.utils.versions.warn_until( 'Sodium', '\'virt.images...
[ "def", "_get_images_dir", "(", ")", ":", "img_dir", "=", "__salt__", "[", "'config.option'", "]", "(", "'virt.images'", ")", "if", "img_dir", ":", "salt", ".", "utils", ".", "versions", ".", "warn_until", "(", "'Sodium'", ",", "'\\'virt.images\\' has been deprec...
Extract the images dir from the configuration. First attempts to find legacy virt.images, then tries virt:images.
[ "Extract", "the", "images", "dir", "from", "the", "configuration", ".", "First", "attempts", "to", "find", "legacy", "virt", ".", "images", "then", "tries", "virt", ":", "images", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L747-L764
train
Extract the images dir from the configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_zfs_image_create
def _zfs_image_create(vm_name, pool, disk_name, hostname_property_name, sparse_volume, disk_size, disk_image_name): ''' Clones an existing image, or creates a new one. When cl...
python
def _zfs_image_create(vm_name, pool, disk_name, hostname_property_name, sparse_volume, disk_size, disk_image_name): ''' Clones an existing image, or creates a new one. When cl...
[ "def", "_zfs_image_create", "(", "vm_name", ",", "pool", ",", "disk_name", ",", "hostname_property_name", ",", "sparse_volume", ",", "disk_size", ",", "disk_image_name", ")", ":", "if", "not", "disk_image_name", "and", "not", "disk_size", ":", "raise", "CommandExe...
Clones an existing image, or creates a new one. When cloning an image, disk_image_name refers to the source of the clone. If not specified, disk_size is used for creating a new zvol, and sparse_volume determines whether to create a thin provisioned volume. The cloned or new volume can have a ZFS p...
[ "Clones", "an", "existing", "image", "or", "creates", "a", "new", "one", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L767-L833
train
Create a new image on the ZFS filesystem.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_qemu_image_create
def _qemu_image_create(disk, create_overlay=False, saltenv='base'): ''' Create the image file using specified disk_size or/and disk_image Return path to the created image file ''' disk_size = disk.get('size', None) disk_image = disk.get('image', None) if not disk_size and not disk_image: ...
python
def _qemu_image_create(disk, create_overlay=False, saltenv='base'): ''' Create the image file using specified disk_size or/and disk_image Return path to the created image file ''' disk_size = disk.get('size', None) disk_image = disk.get('image', None) if not disk_size and not disk_image: ...
[ "def", "_qemu_image_create", "(", "disk", ",", "create_overlay", "=", "False", ",", "saltenv", "=", "'base'", ")", ":", "disk_size", "=", "disk", ".", "get", "(", "'size'", ",", "None", ")", "disk_image", "=", "disk", ".", "get", "(", "'image'", ",", "...
Create the image file using specified disk_size or/and disk_image Return path to the created image file
[ "Create", "the", "image", "file", "using", "specified", "disk_size", "or", "/", "and", "disk_image" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L836-L925
train
Create the image file using the specified disk size or image and return the path to the created image file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_disk_profile
def _disk_profile(profile, hypervisor, disks=None, vm_name=None, image=None, pool=None, **kwargs): ''' Gather the disk profile from the config or apply the default based on the active hypervisor This is the ``default`` profile for KVM/QEMU, which can be overridden in the configuration: .. code...
python
def _disk_profile(profile, hypervisor, disks=None, vm_name=None, image=None, pool=None, **kwargs): ''' Gather the disk profile from the config or apply the default based on the active hypervisor This is the ``default`` profile for KVM/QEMU, which can be overridden in the configuration: .. code...
[ "def", "_disk_profile", "(", "profile", ",", "hypervisor", ",", "disks", "=", "None", ",", "vm_name", "=", "None", ",", "image", "=", "None", ",", "pool", "=", "None", ",", "*", "*", "kwargs", ")", ":", "default", "=", "[", "{", "'system'", ":", "{...
Gather the disk profile from the config or apply the default based on the active hypervisor This is the ``default`` profile for KVM/QEMU, which can be overridden in the configuration: .. code-block:: yaml virt: disk: default: - system: siz...
[ "Gather", "the", "disk", "profile", "from", "the", "config", "or", "apply", "the", "default", "based", "on", "the", "active", "hypervisor" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L928-L1029
train
Return the disk profile for the active hypervisor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_fill_disk_filename
def _fill_disk_filename(vm_name, disk, hypervisor, **kwargs): ''' Compute the disk file name and update it in the disk value. ''' base_dir = disk.get('pool', None) if hypervisor in ['qemu', 'kvm', 'xen']: # Compute the base directory from the pool property. We may have either a path ...
python
def _fill_disk_filename(vm_name, disk, hypervisor, **kwargs): ''' Compute the disk file name and update it in the disk value. ''' base_dir = disk.get('pool', None) if hypervisor in ['qemu', 'kvm', 'xen']: # Compute the base directory from the pool property. We may have either a path ...
[ "def", "_fill_disk_filename", "(", "vm_name", ",", "disk", ",", "hypervisor", ",", "*", "*", "kwargs", ")", ":", "base_dir", "=", "disk", ".", "get", "(", "'pool'", ",", "None", ")", "if", "hypervisor", "in", "[", "'qemu'", ",", "'kvm'", ",", "'xen'", ...
Compute the disk file name and update it in the disk value.
[ "Compute", "the", "disk", "file", "name", "and", "update", "it", "in", "the", "disk", "value", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1032-L1059
train
Fill the disk file name and source file properties.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_complete_nics
def _complete_nics(interfaces, hypervisor, dmac=None): ''' Complete missing data for network interfaces. ''' vmware_overlay = {'type': 'bridge', 'source': 'DEFAULT', 'model': 'e1000'} kvm_overlay = {'type': 'bridge', 'source': 'br0', 'model': 'virtio'} bhyve_overlay = {'type': 'bridge', 'source...
python
def _complete_nics(interfaces, hypervisor, dmac=None): ''' Complete missing data for network interfaces. ''' vmware_overlay = {'type': 'bridge', 'source': 'DEFAULT', 'model': 'e1000'} kvm_overlay = {'type': 'bridge', 'source': 'br0', 'model': 'virtio'} bhyve_overlay = {'type': 'bridge', 'source...
[ "def", "_complete_nics", "(", "interfaces", ",", "hypervisor", ",", "dmac", "=", "None", ")", ":", "vmware_overlay", "=", "{", "'type'", ":", "'bridge'", ",", "'source'", ":", "'DEFAULT'", ",", "'model'", ":", "'e1000'", "}", "kvm_overlay", "=", "{", "'typ...
Complete missing data for network interfaces.
[ "Complete", "missing", "data", "for", "network", "interfaces", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1062-L1136
train
Complete the NICs for the given network interfaces.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_nic_profile
def _nic_profile(profile_name, hypervisor, dmac=None): ''' Compute NIC data based on profile ''' default = [{'eth0': {}}] # support old location config_data = __salt__['config.option']('virt.nic', {}).get( profile_name, None ) if config_data is not None: salt.utils.ver...
python
def _nic_profile(profile_name, hypervisor, dmac=None): ''' Compute NIC data based on profile ''' default = [{'eth0': {}}] # support old location config_data = __salt__['config.option']('virt.nic', {}).get( profile_name, None ) if config_data is not None: salt.utils.ver...
[ "def", "_nic_profile", "(", "profile_name", ",", "hypervisor", ",", "dmac", "=", "None", ")", ":", "default", "=", "[", "{", "'eth0'", ":", "{", "}", "}", "]", "# support old location", "config_data", "=", "__salt__", "[", "'config.option'", "]", "(", "'vi...
Compute NIC data based on profile
[ "Compute", "NIC", "data", "based", "on", "profile" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1139-L1208
train
Compute NIC data based on profile_name
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_get_merged_nics
def _get_merged_nics(hypervisor, profile, interfaces=None, dmac=None): ''' Get network devices from the profile and merge uer defined ones with them. ''' nicp = _nic_profile(profile, hypervisor, dmac=dmac) if profile else [] log.debug('NIC profile is %s', nicp) if interfaces: users_nics ...
python
def _get_merged_nics(hypervisor, profile, interfaces=None, dmac=None): ''' Get network devices from the profile and merge uer defined ones with them. ''' nicp = _nic_profile(profile, hypervisor, dmac=dmac) if profile else [] log.debug('NIC profile is %s', nicp) if interfaces: users_nics ...
[ "def", "_get_merged_nics", "(", "hypervisor", ",", "profile", ",", "interfaces", "=", "None", ",", "dmac", "=", "None", ")", ":", "nicp", "=", "_nic_profile", "(", "profile", ",", "hypervisor", ",", "dmac", "=", "dmac", ")", "if", "profile", "else", "[",...
Get network devices from the profile and merge uer defined ones with them.
[ "Get", "network", "devices", "from", "the", "profile", "and", "merge", "uer", "defined", "ones", "with", "them", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1211-L1226
train
Get network devices from the profile and merge uer defined ones with them.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
init
def init(name, cpu, mem, image=None, nic='default', interfaces=None, hypervisor=None, start=True, # pylint: disable=redefined-outer-name disk='default', disks=None, saltenv='base', seed=True, install=True, ...
python
def init(name, cpu, mem, image=None, nic='default', interfaces=None, hypervisor=None, start=True, # pylint: disable=redefined-outer-name disk='default', disks=None, saltenv='base', seed=True, install=True, ...
[ "def", "init", "(", "name", ",", "cpu", ",", "mem", ",", "image", "=", "None", ",", "nic", "=", "'default'", ",", "interfaces", "=", "None", ",", "hypervisor", "=", "None", ",", "start", "=", "True", ",", "# pylint: disable=redefined-outer-name", "disk", ...
Initialize a new vm :param name: name of the virtual machine to create :param cpu: Number of virtual CPUs to assign to the virtual machine :param mem: Amount of memory to allocate to the virtual machine in MiB. :param image: Path to a disk image to use as the first disk (Default: ``None``). Dep...
[ "Initialize", "a", "new", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1229-L1723
train
Initialize a virtual machine with the given parameters.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_disks_equal
def _disks_equal(disk1, disk2): ''' Test if two disk elements should be considered like the same device ''' target1 = disk1.find('target') target2 = disk2.find('target') source1 = ElementTree.tostring(disk1.find('source')) if disk1.find('source') is not None else None source2 = ElementTree.t...
python
def _disks_equal(disk1, disk2): ''' Test if two disk elements should be considered like the same device ''' target1 = disk1.find('target') target2 = disk2.find('target') source1 = ElementTree.tostring(disk1.find('source')) if disk1.find('source') is not None else None source2 = ElementTree.t...
[ "def", "_disks_equal", "(", "disk1", ",", "disk2", ")", ":", "target1", "=", "disk1", ".", "find", "(", "'target'", ")", "target2", "=", "disk2", ".", "find", "(", "'target'", ")", "source1", "=", "ElementTree", ".", "tostring", "(", "disk1", ".", "fin...
Test if two disk elements should be considered like the same device
[ "Test", "if", "two", "disk", "elements", "should", "be", "considered", "like", "the", "same", "device" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1726-L1739
train
Test if two disks are considered like the same device
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_nics_equal
def _nics_equal(nic1, nic2): ''' Test if two interface elements should be considered like the same device ''' def _filter_nic(nic): ''' Filter out elements to ignore when comparing nics ''' return { 'type': nic.attrib['type'], 'source': nic.find('...
python
def _nics_equal(nic1, nic2): ''' Test if two interface elements should be considered like the same device ''' def _filter_nic(nic): ''' Filter out elements to ignore when comparing nics ''' return { 'type': nic.attrib['type'], 'source': nic.find('...
[ "def", "_nics_equal", "(", "nic1", ",", "nic2", ")", ":", "def", "_filter_nic", "(", "nic", ")", ":", "'''\n Filter out elements to ignore when comparing nics\n '''", "return", "{", "'type'", ":", "nic", ".", "attrib", "[", "'type'", "]", ",", "'sour...
Test if two interface elements should be considered like the same device
[ "Test", "if", "two", "interface", "elements", "should", "be", "considered", "like", "the", "same", "device" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1742-L1757
train
Test if two NICs are considered like the same device
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_graphics_equal
def _graphics_equal(gfx1, gfx2): ''' Test if two graphics devices should be considered the same device ''' def _filter_graphics(gfx): ''' When the domain is running, the graphics element may contain additional properties with the default values. This function will strip down the ...
python
def _graphics_equal(gfx1, gfx2): ''' Test if two graphics devices should be considered the same device ''' def _filter_graphics(gfx): ''' When the domain is running, the graphics element may contain additional properties with the default values. This function will strip down the ...
[ "def", "_graphics_equal", "(", "gfx1", ",", "gfx2", ")", ":", "def", "_filter_graphics", "(", "gfx", ")", ":", "'''\n When the domain is running, the graphics element may contain additional properties\n with the default values. This function will strip down the default valu...
Test if two graphics devices should be considered the same device
[ "Test", "if", "two", "graphics", "devices", "should", "be", "considered", "the", "same", "device" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1760-L1782
train
Test if two graphics devices should be considered the same device
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_diff_lists
def _diff_lists(old, new, comparator): ''' Compare lists to extract the changes :param old: old list :param new: new list :return: a dictionary with ``unchanged``, ``new``, ``deleted`` and ``sorted`` keys The sorted list is the union of unchanged and new lists, but keeping the original ord...
python
def _diff_lists(old, new, comparator): ''' Compare lists to extract the changes :param old: old list :param new: new list :return: a dictionary with ``unchanged``, ``new``, ``deleted`` and ``sorted`` keys The sorted list is the union of unchanged and new lists, but keeping the original ord...
[ "def", "_diff_lists", "(", "old", ",", "new", ",", "comparator", ")", ":", "def", "_remove_indent", "(", "node", ")", ":", "'''\n Remove the XML indentation to compare XML trees more easily\n '''", "node_copy", "=", "copy", ".", "deepcopy", "(", "node", ...
Compare lists to extract the changes :param old: old list :param new: new list :return: a dictionary with ``unchanged``, ``new``, ``deleted`` and ``sorted`` keys The sorted list is the union of unchanged and new lists, but keeping the original order from the new list.
[ "Compare", "lists", "to", "extract", "the", "changes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1785-L1819
train
Compare lists to extract the changes from the old list and new list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_diff_disk_lists
def _diff_disk_lists(old, new): ''' Compare disk definitions to extract the changes and fix target devices :param old: list of ElementTree nodes representing the old disks :param new: list of ElementTree nodes representing the new disks ''' # Change the target device to avoid duplicates before ...
python
def _diff_disk_lists(old, new): ''' Compare disk definitions to extract the changes and fix target devices :param old: list of ElementTree nodes representing the old disks :param new: list of ElementTree nodes representing the new disks ''' # Change the target device to avoid duplicates before ...
[ "def", "_diff_disk_lists", "(", "old", ",", "new", ")", ":", "# Change the target device to avoid duplicates before diffing: this may lead", "# to additional changes. Think of unchanged disk 'hda' and another disk listed", "# before it becoming 'hda' too... the unchanged need to turn into 'hdb'....
Compare disk definitions to extract the changes and fix target devices :param old: list of ElementTree nodes representing the old disks :param new: list of ElementTree nodes representing the new disks
[ "Compare", "disk", "definitions", "to", "extract", "the", "changes", "and", "fix", "target", "devices" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1822-L1843
train
Compare disk definitions to extract the changes and fix target devices
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_diff_interface_lists
def _diff_interface_lists(old, new): ''' Compare network interface definitions to extract the changes :param old: list of ElementTree nodes representing the old interfaces :param new: list of ElementTree nodes representing the new interfaces ''' diff = _diff_lists(old, new, _nics_equal) # ...
python
def _diff_interface_lists(old, new): ''' Compare network interface definitions to extract the changes :param old: list of ElementTree nodes representing the old interfaces :param new: list of ElementTree nodes representing the new interfaces ''' diff = _diff_lists(old, new, _nics_equal) # ...
[ "def", "_diff_interface_lists", "(", "old", ",", "new", ")", ":", "diff", "=", "_diff_lists", "(", "old", ",", "new", ",", "_nics_equal", ")", "# Remove duplicated addresses mac addresses and let libvirt generate them for us", "macs", "=", "[", "nic", ".", "find", "...
Compare network interface definitions to extract the changes :param old: list of ElementTree nodes representing the old interfaces :param new: list of ElementTree nodes representing the new interfaces
[ "Compare", "network", "interface", "definitions", "to", "extract", "the", "changes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1846-L1862
train
Compare network interface definitions to extract the changes
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
update
def update(name, cpu=0, mem=0, disk_profile=None, disks=None, nic_profile=None, interfaces=None, graphics=None, live=True, **kwargs): ''' Update the definition of an existing domain. :param name: Name of the ...
python
def update(name, cpu=0, mem=0, disk_profile=None, disks=None, nic_profile=None, interfaces=None, graphics=None, live=True, **kwargs): ''' Update the definition of an existing domain. :param name: Name of the ...
[ "def", "update", "(", "name", ",", "cpu", "=", "0", ",", "mem", "=", "0", ",", "disk_profile", "=", "None", ",", "disks", "=", "None", ",", "nic_profile", "=", "None", ",", "interfaces", "=", "None", ",", "graphics", "=", "None", ",", "live", "=", ...
Update the definition of an existing domain. :param name: Name of the domain to update :param cpu: Number of virtual CPUs to assign to the virtual machine :param mem: Amount of memory to allocate to the virtual machine in MiB. :param disk_profile: disk profile to use :param disks: Disk defi...
[ "Update", "the", "definition", "of", "an", "existing", "domain", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L1875-L2061
train
Update the virtual machine definition of an existing domain.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
list_domains
def list_domains(**kwargs): ''' Return a list of available domains. :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to conn...
python
def list_domains(**kwargs): ''' Return a list of available domains. :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to conn...
[ "def", "list_domains", "(", "*", "*", "kwargs", ")", ":", "vms", "=", "[", "]", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "for", "dom", "in", "_get_domain", "(", "conn", ",", "iterable", "=", "True", ")", ":", "vms", ".", "append", ...
Return a list of available domains. :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, overriding defaults ....
[ "Return", "a", "list", "of", "available", "domains", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2064-L2089
train
Return a list of available domains.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
list_active_vms
def list_active_vms(**kwargs): ''' Return a list of names for active virtual machine on the minion :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :p...
python
def list_active_vms(**kwargs): ''' Return a list of names for active virtual machine on the minion :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :p...
[ "def", "list_active_vms", "(", "*", "*", "kwargs", ")", ":", "vms", "=", "[", "]", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "for", "dom", "in", "_get_domain", "(", "conn", ",", "iterable", "=", "True", ",", "inactive", "=", "False", ...
Return a list of names for active virtual machine on the minion :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, ov...
[ "Return", "a", "list", "of", "names", "for", "active", "virtual", "machine", "on", "the", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2092-L2117
train
Return a list of names for active virtual machine on the minion
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
list_inactive_vms
def list_inactive_vms(**kwargs): ''' Return a list of names for inactive virtual machine on the minion :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 ...
python
def list_inactive_vms(**kwargs): ''' Return a list of names for inactive virtual machine on the minion :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 ...
[ "def", "list_inactive_vms", "(", "*", "*", "kwargs", ")", ":", "vms", "=", "[", "]", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "for", "dom", "in", "_get_domain", "(", "conn", ",", "iterable", "=", "True", ",", "active", "=", "False", ...
Return a list of names for inactive virtual machine on the minion :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, ...
[ "Return", "a", "list", "of", "names", "for", "inactive", "virtual", "machine", "on", "the", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2120-L2145
train
Return a list of names for inactive virtual machine on the minion
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
vm_info
def vm_info(vm_=None, **kwargs): ''' Return detailed information about the vms on this hyper in a list of dicts: :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overridin...
python
def vm_info(vm_=None, **kwargs): ''' Return detailed information about the vms on this hyper in a list of dicts: :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overridin...
[ "def", "vm_info", "(", "vm_", "=", "None", ",", "*", "*", "kwargs", ")", ":", "def", "_info", "(", "dom", ")", ":", "'''\n Compute the infos of a domain\n '''", "raw", "=", "dom", ".", "info", "(", ")", "return", "{", "'cpu'", ":", "raw", "...
Return detailed information about the vms on this hyper in a list of dicts: :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2....
[ "Return", "detailed", "information", "about", "the", "vms", "on", "this", "hyper", "in", "a", "list", "of", "dicts", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2148-L2212
train
Return detailed information about the vms on this hyper in a a list of dicts.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
vm_state
def vm_state(vm_=None, **kwargs): ''' Return list of all the vms and their state. If you pass a VM name in as an argument then it will return info for just the named VM, otherwise it will return all VMs. :param vm_: name of the domain :param connection: libvirt connection URI, overriding defau...
python
def vm_state(vm_=None, **kwargs): ''' Return list of all the vms and their state. If you pass a VM name in as an argument then it will return info for just the named VM, otherwise it will return all VMs. :param vm_: name of the domain :param connection: libvirt connection URI, overriding defau...
[ "def", "vm_state", "(", "vm_", "=", "None", ",", "*", "*", "kwargs", ")", ":", "def", "_info", "(", "dom", ")", ":", "'''\n Compute domain state\n '''", "state", "=", "''", "raw", "=", "dom", ".", "info", "(", ")", "state", "=", "VIRT_STATE...
Return list of all the vms and their state. If you pass a VM name in as an argument then it will return info for just the named VM, otherwise it will return all VMs. :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :p...
[ "Return", "list", "of", "all", "the", "vms", "and", "their", "state", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2215-L2255
train
Return list of all the VMs and their state.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_node_info
def _node_info(conn): ''' Internal variant of node_info taking a libvirt connection as parameter ''' raw = conn.getInfo() info = {'cpucores': raw[6], 'cpumhz': raw[3], 'cpumodel': six.text_type(raw[0]), 'cpus': raw[2], 'cputhreads': raw[7], ...
python
def _node_info(conn): ''' Internal variant of node_info taking a libvirt connection as parameter ''' raw = conn.getInfo() info = {'cpucores': raw[6], 'cpumhz': raw[3], 'cpumodel': six.text_type(raw[0]), 'cpus': raw[2], 'cputhreads': raw[7], ...
[ "def", "_node_info", "(", "conn", ")", ":", "raw", "=", "conn", ".", "getInfo", "(", ")", "info", "=", "{", "'cpucores'", ":", "raw", "[", "6", "]", ",", "'cpumhz'", ":", "raw", "[", "3", "]", ",", "'cpumodel'", ":", "six", ".", "text_type", "(",...
Internal variant of node_info taking a libvirt connection as parameter
[ "Internal", "variant", "of", "node_info", "taking", "a", "libvirt", "connection", "as", "parameter" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2258-L2271
train
Internal variant of node_info taking a libvirt connection as parameter
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
node_info
def node_info(**kwargs): ''' Return a dict with information about this node :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password...
python
def node_info(**kwargs): ''' Return a dict with information about this node :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password...
[ "def", "node_info", "(", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "info", "=", "_node_info", "(", "conn", ")", "conn", ".", "close", "(", ")", "return", "info" ]
Return a dict with information about this node :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, overriding defaults...
[ "Return", "a", "dict", "with", "information", "about", "this", "node" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2274-L2297
train
Return a dict with information about this node
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
get_nics
def get_nics(vm_, **kwargs): ''' Return info about the network interfaces of a named vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versio...
python
def get_nics(vm_, **kwargs): ''' Return info about the network interfaces of a named vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versio...
[ "def", "get_nics", "(", "vm_", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "nics", "=", "_get_nics", "(", "_get_domain", "(", "conn", ",", "vm_", ")", ")", "conn", ".", "close", "(", ")", "return", ...
Return info about the network interfaces of a named vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: pa...
[ "Return", "info", "about", "the", "network", "interfaces", "of", "a", "named", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2300-L2324
train
Return info about the network interfaces of a named vm
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
get_macs
def get_macs(vm_, **kwargs): ''' Return a list off MAC addresses from the named vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadde...
python
def get_macs(vm_, **kwargs): ''' Return a list off MAC addresses from the named vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadde...
[ "def", "get_macs", "(", "vm_", ",", "*", "*", "kwargs", ")", ":", "doc", "=", "ElementTree", ".", "fromstring", "(", "get_xml", "(", "vm_", ",", "*", "*", "kwargs", ")", ")", "return", "[", "node", ".", "get", "(", "'address'", ")", "for", "node", ...
Return a list off MAC addresses from the named vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: passwor...
[ "Return", "a", "list", "off", "MAC", "addresses", "from", "the", "named", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2327-L2349
train
Return a list off MAC addresses from the named vm
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
get_graphics
def get_graphics(vm_, **kwargs): ''' Returns the information on vnc for a given vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadde...
python
def get_graphics(vm_, **kwargs): ''' Returns the information on vnc for a given vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadde...
[ "def", "get_graphics", "(", "vm_", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "graphics", "=", "_get_graphics", "(", "_get_domain", "(", "conn", ",", "vm_", ")", ")", "conn", ".", "close", "(", ")", ...
Returns the information on vnc for a given vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to...
[ "Returns", "the", "information", "on", "vnc", "for", "a", "given", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2352-L2376
train
Returns the graphics information on a given domain
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
get_loader
def get_loader(vm_, **kwargs): ''' Returns the information on the loader for a given vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults :param username: username to connect with, overriding defaults :param password: password to connect with, overrid...
python
def get_loader(vm_, **kwargs): ''' Returns the information on the loader for a given vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults :param username: username to connect with, overriding defaults :param password: password to connect with, overrid...
[ "def", "get_loader", "(", "vm_", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "loader", "=", "_get_loader", "(", "_get_domain", "(", "conn", ",", "vm_", ")", ")", "conn", ".", "close", "(", ")", "retur...
Returns the information on the loader for a given vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults :param username: username to connect with, overriding defaults :param password: password to connect with, overriding defaults CLI Example: .. code...
[ "Returns", "the", "information", "on", "the", "loader", "for", "a", "given", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2379-L2399
train
Returns the information on the loader for a given domain
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
get_disks
def get_disks(vm_, **kwargs): ''' Return the disks of a named vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :...
python
def get_disks(vm_, **kwargs): ''' Return the disks of a named vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :...
[ "def", "get_disks", "(", "vm_", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "disks", "=", "_get_disks", "(", "_get_domain", "(", "conn", ",", "vm_", ")", ")", "conn", ".", "close", "(", ")", "return",...
Return the disks of a named vm :param vm_: name of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, ...
[ "Return", "the", "disks", "of", "a", "named", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2402-L2426
train
Return the disks of a named vm
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
setmem
def setmem(vm_, memory, config=False, **kwargs): ''' Changes the amount of memory allocated to VM. The VM must be shutdown for this to work. :param vm_: name of the domain :param memory: memory amount to set in MB :param config: if True then libvirt will be asked to modify the config as well ...
python
def setmem(vm_, memory, config=False, **kwargs): ''' Changes the amount of memory allocated to VM. The VM must be shutdown for this to work. :param vm_: name of the domain :param memory: memory amount to set in MB :param config: if True then libvirt will be asked to modify the config as well ...
[ "def", "setmem", "(", "vm_", ",", "memory", ",", "config", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "dom", "=", "_get_domain", "(", "conn", ",", "vm_", ")", "if", "VIRT_STATE_NAME_MAP",...
Changes the amount of memory allocated to VM. The VM must be shutdown for this to work. :param vm_: name of the domain :param memory: memory amount to set in MB :param config: if True then libvirt will be asked to modify the config as well :param connection: libvirt connection URI, overriding defau...
[ "Changes", "the", "amount", "of", "memory", "allocated", "to", "VM", ".", "The", "VM", "must", "be", "shutdown", "for", "this", "to", "work", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2429-L2473
train
Sets the amount of memory allocated to VM.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
setvcpus
def setvcpus(vm_, vcpus, config=False, **kwargs): ''' Changes the amount of vcpus allocated to VM. The VM must be shutdown for this to work. If config is True then we ask libvirt to modify the config as well :param vm_: name of the domain :param vcpus: integer representing the number of CPUs t...
python
def setvcpus(vm_, vcpus, config=False, **kwargs): ''' Changes the amount of vcpus allocated to VM. The VM must be shutdown for this to work. If config is True then we ask libvirt to modify the config as well :param vm_: name of the domain :param vcpus: integer representing the number of CPUs t...
[ "def", "setvcpus", "(", "vm_", ",", "vcpus", ",", "config", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "dom", "=", "_get_domain", "(", "conn", ",", "vm_", ")", "if", "VIRT_STATE_NAME_MAP"...
Changes the amount of vcpus allocated to VM. The VM must be shutdown for this to work. If config is True then we ask libvirt to modify the config as well :param vm_: name of the domain :param vcpus: integer representing the number of CPUs to be assigned :param config: if True then libvirt will be ...
[ "Changes", "the", "amount", "of", "vcpus", "allocated", "to", "VM", ".", "The", "VM", "must", "be", "shutdown", "for", "this", "to", "work", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2476-L2519
train
Sets the amount of vcpus allocated to a VM.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_freemem
def _freemem(conn): ''' Internal variant of freemem taking a libvirt connection as parameter ''' mem = conn.getInfo()[1] # Take off just enough to sustain the hypervisor mem -= 256 for dom in _get_domain(conn, iterable=True): if dom.ID() > 0: mem -= dom.info()[2] / 1024 ...
python
def _freemem(conn): ''' Internal variant of freemem taking a libvirt connection as parameter ''' mem = conn.getInfo()[1] # Take off just enough to sustain the hypervisor mem -= 256 for dom in _get_domain(conn, iterable=True): if dom.ID() > 0: mem -= dom.info()[2] / 1024 ...
[ "def", "_freemem", "(", "conn", ")", ":", "mem", "=", "conn", ".", "getInfo", "(", ")", "[", "1", "]", "# Take off just enough to sustain the hypervisor", "mem", "-=", "256", "for", "dom", "in", "_get_domain", "(", "conn", ",", "iterable", "=", "True", ")"...
Internal variant of freemem taking a libvirt connection as parameter
[ "Internal", "variant", "of", "freemem", "taking", "a", "libvirt", "connection", "as", "parameter" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2522-L2532
train
Internal variant of freemem taking a libvirt connection as parameter
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
freemem
def freemem(**kwargs): ''' Return an int representing the amount of memory (in MB) that has not been given to virtual machines on this node :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaul...
python
def freemem(**kwargs): ''' Return an int representing the amount of memory (in MB) that has not been given to virtual machines on this node :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaul...
[ "def", "freemem", "(", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "mem", "=", "_freemem", "(", "conn", ")", "conn", ".", "close", "(", ")", "return", "mem" ]
Return an int representing the amount of memory (in MB) that has not been given to virtual machines on this node :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019....
[ "Return", "an", "int", "representing", "the", "amount", "of", "memory", "(", "in", "MB", ")", "that", "has", "not", "been", "given", "to", "virtual", "machines", "on", "this", "node" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2535-L2559
train
Return the amount of memory that has not been given to virtual machines on this node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
_freecpu
def _freecpu(conn): ''' Internal variant of freecpu taking a libvirt connection as parameter ''' cpus = conn.getInfo()[2] for dom in _get_domain(conn, iterable=True): if dom.ID() > 0: cpus -= dom.info()[3] return cpus
python
def _freecpu(conn): ''' Internal variant of freecpu taking a libvirt connection as parameter ''' cpus = conn.getInfo()[2] for dom in _get_domain(conn, iterable=True): if dom.ID() > 0: cpus -= dom.info()[3] return cpus
[ "def", "_freecpu", "(", "conn", ")", ":", "cpus", "=", "conn", ".", "getInfo", "(", ")", "[", "2", "]", "for", "dom", "in", "_get_domain", "(", "conn", ",", "iterable", "=", "True", ")", ":", "if", "dom", ".", "ID", "(", ")", ">", "0", ":", "...
Internal variant of freecpu taking a libvirt connection as parameter
[ "Internal", "variant", "of", "freecpu", "taking", "a", "libvirt", "connection", "as", "parameter" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2562-L2570
train
Internal variant of freecpu taking a libvirt connection as parameter
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
freecpu
def freecpu(**kwargs): ''' Return an int representing the number of unallocated cpus on this hypervisor :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2...
python
def freecpu(**kwargs): ''' Return an int representing the number of unallocated cpus on this hypervisor :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2...
[ "def", "freecpu", "(", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "cpus", "=", "_freecpu", "(", "conn", ")", "conn", ".", "close", "(", ")", "return", "cpus" ]
Return an int representing the number of unallocated cpus on this hypervisor :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to...
[ "Return", "an", "int", "representing", "the", "number", "of", "unallocated", "cpus", "on", "this", "hypervisor" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2573-L2597
train
Return an integer representing the number of unallocated cpus on this hypervisor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
full_info
def full_info(**kwargs): ''' Return the node_info, vm_info and freemem :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to c...
python
def full_info(**kwargs): ''' Return the node_info, vm_info and freemem :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to c...
[ "def", "full_info", "(", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "info", "=", "{", "'freecpu'", ":", "_freecpu", "(", "conn", ")", ",", "'freemem'", ":", "_freemem", "(", "conn", ")", ",", "'node_info'",...
Return the node_info, vm_info and freemem :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, overriding defaults ...
[ "Return", "the", "node_info", "vm_info", "and", "freemem" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2600-L2626
train
Return the node_info vm_info and freemem_info.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
get_xml
def get_xml(vm_, **kwargs): ''' Returns the XML for a given vm :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param pas...
python
def get_xml(vm_, **kwargs): ''' Returns the XML for a given vm :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param pas...
[ "def", "get_xml", "(", "vm_", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "xml_desc", "=", "_get_domain", "(", "conn", ",", "vm_", ")", ".", "XMLDesc", "(", "0", ")", "conn", ".", "close", "(", ")",...
Returns the XML for a given vm :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, overrid...
[ "Returns", "the", "XML", "for", "a", "given", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2629-L2653
train
Returns the XML for a given domain name
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
get_profiles
def get_profiles(hypervisor=None, **kwargs): ''' Return the virt profiles for hypervisor. Currently there are profiles for: - nic - disk :param hypervisor: override the default machine type. :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0...
python
def get_profiles(hypervisor=None, **kwargs): ''' Return the virt profiles for hypervisor. Currently there are profiles for: - nic - disk :param hypervisor: override the default machine type. :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0...
[ "def", "get_profiles", "(", "hypervisor", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "}", "caps", "=", "capabilities", "(", "*", "*", "kwargs", ")", "hypervisors", "=", "sorted", "(", "{", "x", "for", "y", "in", "[", "guest", ...
Return the virt profiles for hypervisor. Currently there are profiles for: - nic - disk :param hypervisor: override the default machine type. :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overridin...
[ "Return", "the", "virt", "profiles", "for", "hypervisor", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2656-L2711
train
Return the virt profiles for the given hypervisor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
pause
def pause(vm_, **kwargs): ''' Pause the named vm :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: passwor...
python
def pause(vm_, **kwargs): ''' Pause the named vm :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: passwor...
[ "def", "pause", "(", "vm_", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "dom", "=", "_get_domain", "(", "conn", ",", "vm_", ")", "ret", "=", "dom", ".", "suspend", "(", ")", "==", "0", "conn", "."...
Pause the named vm :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, overriding defaults...
[ "Pause", "the", "named", "vm" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2742-L2767
train
Pause the named vm
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
start
def start(name, **kwargs): ''' Start a defined domain :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: pa...
python
def start(name, **kwargs): ''' Start a defined domain :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: pa...
[ "def", "start", "(", "name", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "ret", "=", "_get_domain", "(", "conn", ",", "name", ")", ".", "create", "(", ")", "==", "0", "conn", ".", "close", "(", ")...
Start a defined domain :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, overriding defa...
[ "Start", "a", "defined", "domain" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2798-L2822
train
Start a libvirt domain
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
stop
def stop(name, **kwargs): ''' Hard power down the virtual machine, this is equivalent to pulling the power. :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults ...
python
def stop(name, **kwargs): ''' Hard power down the virtual machine, this is equivalent to pulling the power. :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults ...
[ "def", "stop", "(", "name", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "ret", "=", "_get_domain", "(", "conn", ",", "name", ")", ".", "destroy", "(", ")", "==", "0", "conn", ".", "close", "(", ")...
Hard power down the virtual machine, this is equivalent to pulling the power. :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :pa...
[ "Hard", "power", "down", "the", "virtual", "machine", "this", "is", "equivalent", "to", "pulling", "the", "power", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2825-L2849
train
Stop a virtual machine.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
reboot
def reboot(name, **kwargs): ''' Reboot a domain via ACPI request :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param p...
python
def reboot(name, **kwargs): ''' Reboot a domain via ACPI request :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param p...
[ "def", "reboot", "(", "name", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "ret", "=", "_get_domain", "(", "conn", ",", "name", ")", ".", "reboot", "(", "libvirt", ".", "VIR_DOMAIN_REBOOT_DEFAULT", ")", ...
Reboot a domain via ACPI request :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, overr...
[ "Reboot", "a", "domain", "via", "ACPI", "request" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2852-L2876
train
Reboot a domain via ACPI request
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
reset
def reset(vm_, **kwargs): ''' Reset a VM by emulating the reset button on a physical machine :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versiona...
python
def reset(vm_, **kwargs): ''' Reset a VM by emulating the reset button on a physical machine :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versiona...
[ "def", "reset", "(", "vm_", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "dom", "=", "_get_domain", "(", "conn", ",", "vm_", ")", "# reset takes a flag, like reboot, but it is not yet used", "# so we just pass in 0"...
Reset a VM by emulating the reset button on a physical machine :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: p...
[ "Reset", "a", "VM", "by", "emulating", "the", "reset", "button", "on", "a", "physical", "machine" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2879-L2908
train
Reset a virtual machine on a physical machine
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
ctrl_alt_del
def ctrl_alt_del(vm_, **kwargs): ''' Sends CTRL+ALT+DEL to a VM :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param pa...
python
def ctrl_alt_del(vm_, **kwargs): ''' Sends CTRL+ALT+DEL to a VM :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param pa...
[ "def", "ctrl_alt_del", "(", "vm_", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "dom", "=", "_get_domain", "(", "conn", ",", "vm_", ")", "ret", "=", "dom", ".", "sendKey", "(", "0", ",", "0", ",", ...
Sends CTRL+ALT+DEL to a VM :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019.2.0 :param password: password to connect with, overriding ...
[ "Sends", "CTRL", "+", "ALT", "+", "DEL", "to", "a", "VM" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2911-L2936
train
Send a CTRL + ALT + DEL to a VM
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
create_xml_str
def create_xml_str(xml, **kwargs): # pylint: disable=redefined-outer-name ''' Start a transient domain based on the XML passed to the function :param xml: libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param ...
python
def create_xml_str(xml, **kwargs): # pylint: disable=redefined-outer-name ''' Start a transient domain based on the XML passed to the function :param xml: libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param ...
[ "def", "create_xml_str", "(", "xml", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=redefined-outer-name", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "ret", "=", "conn", ".", "createXML", "(", "xml", ",", "0", ")", "is", "not", "None...
Start a transient domain based on the XML passed to the function :param xml: libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019...
[ "Start", "a", "transient", "domain", "based", "on", "the", "XML", "passed", "to", "the", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2939-L2963
train
Create a transient domain based on the XML passed to the function
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
create_xml_path
def create_xml_path(path, **kwargs): ''' Start a transient domain based on the XML-file path passed to the function :param path: path to a file containing the libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :par...
python
def create_xml_path(path, **kwargs): ''' Start a transient domain based on the XML-file path passed to the function :param path: path to a file containing the libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :par...
[ "def", "create_xml_path", "(", "path", ",", "*", "*", "kwargs", ")", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'r'", ")", "as", "fp_", ":", "return", "create_xml_str", "(", "salt", ".", "utils", "...
Start a transient domain based on the XML-file path passed to the function :param path: path to a file containing the libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding...
[ "Start", "a", "transient", "domain", "based", "on", "the", "XML", "-", "file", "path", "passed", "to", "the", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2966-L2994
train
Create a transient domain based on the XML - file at the given path.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
define_xml_str
def define_xml_str(xml, **kwargs): # pylint: disable=redefined-outer-name ''' Define a persistent domain based on the XML passed to the function :param xml: libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :para...
python
def define_xml_str(xml, **kwargs): # pylint: disable=redefined-outer-name ''' Define a persistent domain based on the XML passed to the function :param xml: libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :para...
[ "def", "define_xml_str", "(", "xml", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=redefined-outer-name", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "ret", "=", "conn", ".", "defineXML", "(", "xml", ")", "is", "not", "None", "conn", ...
Define a persistent domain based on the XML passed to the function :param xml: libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 20...
[ "Define", "a", "persistent", "domain", "based", "on", "the", "XML", "passed", "to", "the", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L2997-L3021
train
Define a persistent domain based on the XML passed to the function
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
define_xml_path
def define_xml_path(path, **kwargs): ''' Define a persistent domain based on the XML-file path passed to the function :param path: path to a file containing the libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :p...
python
def define_xml_path(path, **kwargs): ''' Define a persistent domain based on the XML-file path passed to the function :param path: path to a file containing the libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :p...
[ "def", "define_xml_path", "(", "path", ",", "*", "*", "kwargs", ")", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'r'", ")", "as", "fp_", ":", "return", "define_xml_str", "(", "salt", ".", "utils", "...
Define a persistent domain based on the XML-file path passed to the function :param path: path to a file containing the libvirt XML definition of the domain :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overridi...
[ "Define", "a", "persistent", "domain", "based", "on", "the", "XML", "-", "file", "path", "passed", "to", "the", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L3024-L3053
train
This function will define a persistent domain based on the XML - file path passed to the function ArcGIS
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
define_vol_xml_str
def define_vol_xml_str(xml, **kwargs): # pylint: disable=redefined-outer-name ''' Define a volume based on the XML passed to the function :param xml: libvirt XML definition of the storage volume :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :par...
python
def define_vol_xml_str(xml, **kwargs): # pylint: disable=redefined-outer-name ''' Define a volume based on the XML passed to the function :param xml: libvirt XML definition of the storage volume :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :par...
[ "def", "define_vol_xml_str", "(", "xml", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=redefined-outer-name", "poolname", "=", "__salt__", "[", "'config.get'", "]", "(", "'libvirt:storagepool'", ",", "None", ")", "if", "poolname", "is", "not", "None", ":...
Define a volume based on the XML passed to the function :param xml: libvirt XML definition of the storage volume :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults .. versionadded:: 2019....
[ "Define", "a", "volume", "based", "on", "the", "XML", "passed", "to", "the", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L3056-L3100
train
Define a libvirt storage volume based on the XML passed to the function
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
define_vol_xml_path
def define_vol_xml_path(path, **kwargs): ''' Define a volume based on the XML-file path passed to the function :param path: path to a file containing the libvirt XML definition of the volume :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param us...
python
def define_vol_xml_path(path, **kwargs): ''' Define a volume based on the XML-file path passed to the function :param path: path to a file containing the libvirt XML definition of the volume :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param us...
[ "def", "define_vol_xml_path", "(", "path", ",", "*", "*", "kwargs", ")", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'r'", ")", "as", "fp_", ":", "return", "define_vol_xml_str", "(", "salt", ".", "uti...
Define a volume based on the XML-file path passed to the function :param path: path to a file containing the libvirt XML definition of the volume :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults...
[ "Define", "a", "volume", "based", "on", "the", "XML", "-", "file", "path", "passed", "to", "the", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L3103-L3132
train
This function will define a libvirt XML file on the node with the given path.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
migrate_non_shared
def migrate_non_shared(vm_, target, ssh=False): ''' Attempt to execute non-shared storage "all" migration :param vm_: domain name :param target: target libvirt host name :param ssh: True to connect over ssh CLI Example: .. code-block:: bash salt '*' virt.migrate_non_shared <vm na...
python
def migrate_non_shared(vm_, target, ssh=False): ''' Attempt to execute non-shared storage "all" migration :param vm_: domain name :param target: target libvirt host name :param ssh: True to connect over ssh CLI Example: .. code-block:: bash salt '*' virt.migrate_non_shared <vm na...
[ "def", "migrate_non_shared", "(", "vm_", ",", "target", ",", "ssh", "=", "False", ")", ":", "cmd", "=", "_get_migrate_command", "(", ")", "+", "' --copy-storage-all '", "+", "vm_", "+", "_get_target", "(", "target", ",", "ssh", ")", "stdout", "=", "subproc...
Attempt to execute non-shared storage "all" migration :param vm_: domain name :param target: target libvirt host name :param ssh: True to connect over ssh CLI Example: .. code-block:: bash salt '*' virt.migrate_non_shared <vm name> <target hypervisor> A tunnel data migration can be ...
[ "Attempt", "to", "execute", "non", "-", "shared", "storage", "all", "migration" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L3135-L3166
train
Execute a migration on the non - shared storage.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
seed_non_shared_migrate
def seed_non_shared_migrate(disks, force=False): ''' Non shared migration requires that the disks be present on the migration destination, pass the disks information via this function, to the migration destination before executing the migration. :param disks: the list of disk data as provided by vi...
python
def seed_non_shared_migrate(disks, force=False): ''' Non shared migration requires that the disks be present on the migration destination, pass the disks information via this function, to the migration destination before executing the migration. :param disks: the list of disk data as provided by vi...
[ "def", "seed_non_shared_migrate", "(", "disks", ",", "force", "=", "False", ")", ":", "for", "_", ",", "data", "in", "six", ".", "iteritems", "(", "disks", ")", ":", "fn_", "=", "data", "[", "'file'", "]", "form", "=", "data", "[", "'file format'", "...
Non shared migration requires that the disks be present on the migration destination, pass the disks information via this function, to the migration destination before executing the migration. :param disks: the list of disk data as provided by virt.get_disks :param force: skip checking the compatibilit...
[ "Non", "shared", "migration", "requires", "that", "the", "disks", "be", "present", "on", "the", "migration", "destination", "pass", "the", "disks", "information", "via", "this", "function", "to", "the", "migration", "destination", "before", "executing", "the", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L3237-L3274
train
Seed non shared migration on the specified disks.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
set_autostart
def set_autostart(vm_, state='on', **kwargs): ''' Set the autostart flag on a VM so that the VM will start with the host system on reboot. :param vm_: domain name :param state: 'on' to auto start the pool, anything else to mark the pool not to be started when the host boots :p...
python
def set_autostart(vm_, state='on', **kwargs): ''' Set the autostart flag on a VM so that the VM will start with the host system on reboot. :param vm_: domain name :param state: 'on' to auto start the pool, anything else to mark the pool not to be started when the host boots :p...
[ "def", "set_autostart", "(", "vm_", ",", "state", "=", "'on'", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "dom", "=", "_get_domain", "(", "conn", ",", "vm_", ")", "# return False if state is set to something...
Set the autostart flag on a VM so that the VM will start with the host system on reboot. :param vm_: domain name :param state: 'on' to auto start the pool, anything else to mark the pool not to be started when the host boots :param connection: libvirt connection URI, overriding defaul...
[ "Set", "the", "autostart", "flag", "on", "a", "VM", "so", "that", "the", "VM", "will", "start", "with", "the", "host", "system", "on", "reboot", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L3277-L3314
train
Sets the autostart flag on a VM.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/virt.py
undefine
def undefine(vm_, **kwargs): ''' Remove a defined vm, this does not purge the virtual machine image, and this only works if the vm is powered down :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username...
python
def undefine(vm_, **kwargs): ''' Remove a defined vm, this does not purge the virtual machine image, and this only works if the vm is powered down :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username...
[ "def", "undefine", "(", "vm_", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "__get_conn", "(", "*", "*", "kwargs", ")", "dom", "=", "_get_domain", "(", "conn", ",", "vm_", ")", "if", "getattr", "(", "libvirt", ",", "'VIR_DOMAIN_UNDEFINE_NVRAM'", ","...
Remove a defined vm, this does not purge the virtual machine image, and this only works if the vm is powered down :param vm_: domain name :param connection: libvirt connection URI, overriding defaults .. versionadded:: 2019.2.0 :param username: username to connect with, overriding defaults ...
[ "Remove", "a", "defined", "vm", "this", "does", "not", "purge", "the", "virtual", "machine", "image", "and", "this", "only", "works", "if", "the", "vm", "is", "powered", "down" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virt.py#L3317-L3347
train
Remove a defined vm from the virtual machine image and return True if the vm is powered down.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...