mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 00:25:22 +00:00
Modernize the salt-cloud script
This commit is contained in:
parent
99bbf9ea9a
commit
5de4e73d4d
@ -10,6 +10,7 @@ import sys
|
||||
# Import salt libs
|
||||
import salt
|
||||
import salt.cli
|
||||
import salt.cloud.cli
|
||||
|
||||
|
||||
def salt_master():
|
||||
@ -105,6 +106,19 @@ def salt_ssh():
|
||||
raise SystemExit('\nExiting gracefully on Ctrl-c')
|
||||
|
||||
|
||||
def salt_cloud():
|
||||
'''
|
||||
The main function for salt-cloud
|
||||
'''
|
||||
if '' in sys.path:
|
||||
sys.path.remove('')
|
||||
try:
|
||||
cloud = salt.cloud.cli.SaltCloud()
|
||||
cloud.run()
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit('\nExiting gracefully on Ctrl-c')
|
||||
|
||||
|
||||
def salt_main():
|
||||
'''
|
||||
Publish commands to the salt system from the command line on the
|
||||
|
@ -1,16 +1,10 @@
|
||||
#!/usr/bin/env python
|
||||
'''
|
||||
Publish commands to the salt system from the command line on the master.
|
||||
'''
|
||||
|
||||
import salt.cloud.cli
|
||||
from salt.scripts import salt_cloud
|
||||
|
||||
def main():
|
||||
'''
|
||||
The main function for salt-cloud
|
||||
'''
|
||||
cloud = salt.cloud.cli.SaltCloud()
|
||||
cloud.run()
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit('\nExiting gracefully on Ctrl-c')
|
||||
salt_cloud()
|
||||
|
Loading…
Reference in New Issue
Block a user