mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Ensured use of get_machine_identifier from salt.utils.files for identifying a machine id
This commit is contained in:
parent
f98b7073cd
commit
0de790cd28
4 changed files with 6 additions and 6 deletions
|
@ -3048,7 +3048,7 @@ def get_machine_id():
|
||||||
if platform.system() == "AIX":
|
if platform.system() == "AIX":
|
||||||
return _aix_get_machine_id()
|
return _aix_get_machine_id()
|
||||||
|
|
||||||
return salt.utils.files.local_get_machine_id()
|
return salt.utils.files.get_machine_identifier()
|
||||||
|
|
||||||
|
|
||||||
def cwd():
|
def cwd():
|
||||||
|
|
|
@ -906,7 +906,7 @@ def get_encoding(path):
|
||||||
raise CommandExecutionError("Could not detect file encoding")
|
raise CommandExecutionError("Could not detect file encoding")
|
||||||
|
|
||||||
|
|
||||||
def local_get_machine_id():
|
def get_machine_identifier():
|
||||||
"""
|
"""
|
||||||
Provide the machine-id for machine/virtualization combination
|
Provide the machine-id for machine/virtualization combination
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1075,7 +1075,7 @@ class SignalHandlingProcess(Process):
|
||||||
msg += ". Exiting"
|
msg += ". Exiting"
|
||||||
log.debug(msg)
|
log.debug(msg)
|
||||||
|
|
||||||
mach_id = salt.utils.files.local_get_machine_id().get(
|
mach_id = salt.utils.files.get_machine_identifier().get(
|
||||||
"machine_id", "no_machine_id_available"
|
"machine_id", "no_machine_id_available"
|
||||||
)
|
)
|
||||||
log.debug(
|
log.debug(
|
||||||
|
|
|
@ -377,7 +377,7 @@ def test_git_provider_mp_gen_lock(main_class, caplog):
|
||||||
Check that gen_lock is obtains lock, and then releases, provider.lock()
|
Check that gen_lock is obtains lock, and then releases, provider.lock()
|
||||||
"""
|
"""
|
||||||
# get machine_identifier
|
# get machine_identifier
|
||||||
mach_id = salt.utils.files.local_get_machine_id().get(
|
mach_id = salt.utils.files.get_machine_identifier().get(
|
||||||
"machine_id", "no_machine_id_available"
|
"machine_id", "no_machine_id_available"
|
||||||
)
|
)
|
||||||
cur_pid = os.getpid()
|
cur_pid = os.getpid()
|
||||||
|
@ -413,7 +413,7 @@ def test_git_provider_mp_lock_dead_pid(main_class, caplog):
|
||||||
Check that lock obtains lock, if previous pid in lock file doesn't exist for same machine id
|
Check that lock obtains lock, if previous pid in lock file doesn't exist for same machine id
|
||||||
"""
|
"""
|
||||||
# get machine_identifier
|
# get machine_identifier
|
||||||
mach_id = salt.utils.files.local_get_machine_id().get(
|
mach_id = salt.utils.files.get_machine_identifier().get(
|
||||||
"machine_id", "no_machine_id_available"
|
"machine_id", "no_machine_id_available"
|
||||||
)
|
)
|
||||||
cur_pid = os.getpid()
|
cur_pid = os.getpid()
|
||||||
|
@ -487,7 +487,7 @@ def test_git_provider_mp_lock_bad_machine(main_class, caplog):
|
||||||
Check that lock obtains lock, if previous pid in lock file doesn't exist for same machine id
|
Check that lock obtains lock, if previous pid in lock file doesn't exist for same machine id
|
||||||
"""
|
"""
|
||||||
# get machine_identifier
|
# get machine_identifier
|
||||||
mach_id = salt.utils.files.local_get_machine_id().get(
|
mach_id = salt.utils.files.get_machine_identifier().get(
|
||||||
"machine_id", "no_machine_id_available"
|
"machine_id", "no_machine_id_available"
|
||||||
)
|
)
|
||||||
cur_pid = os.getpid()
|
cur_pid = os.getpid()
|
||||||
|
|
Loading…
Add table
Reference in a new issue