mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Bugfix: crashes when OPTIONS.saltdir is a file
This commit is contained in:
parent
e651278015
commit
3050b3a8cf
@ -217,9 +217,6 @@ def main(argv): # pylint: disable=W0613
|
|||||||
if scpstat != 0:
|
if scpstat != 0:
|
||||||
sys.exit(EX_SCP_NOT_FOUND)
|
sys.exit(EX_SCP_NOT_FOUND)
|
||||||
|
|
||||||
if not os.path.exists(OPTIONS.saltdir):
|
|
||||||
need_deployment()
|
|
||||||
|
|
||||||
if not os.path.isdir(OPTIONS.saltdir):
|
if not os.path.isdir(OPTIONS.saltdir):
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
'ERROR: salt path "{0}" exists but is'
|
'ERROR: salt path "{0}" exists but is'
|
||||||
@ -227,6 +224,9 @@ def main(argv): # pylint: disable=W0613
|
|||||||
)
|
)
|
||||||
sys.exit(EX_CANTCREAT)
|
sys.exit(EX_CANTCREAT)
|
||||||
|
|
||||||
|
if not os.path.exists(OPTIONS.saltdir):
|
||||||
|
need_deployment()
|
||||||
|
|
||||||
version_path = os.path.normpath(os.path.join(OPTIONS.saltdir, 'version'))
|
version_path = os.path.normpath(os.path.join(OPTIONS.saltdir, 'version'))
|
||||||
if not os.path.exists(version_path) or not os.path.isfile(version_path):
|
if not os.path.exists(version_path) or not os.path.isfile(version_path):
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
|
Loading…
Reference in New Issue
Block a user