mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Merge pull request #9680 from s0undt3ch/develop
Use the `__virtualname__` attribute
This commit is contained in:
commit
5b27a9a5c3
@ -12,11 +12,14 @@ for example /etc/sysctl.conf
|
||||
'''
|
||||
|
||||
|
||||
__virtualname__ = 'ini'
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only load if the mysql module is available
|
||||
'''
|
||||
return 'ini' if 'ini.set_option' in __salt__ else False
|
||||
return __virtualname__ if 'ini.set_option' in __salt__ else False
|
||||
|
||||
|
||||
def options_present(name, sections=None):
|
||||
|
@ -463,17 +463,17 @@ def parse():
|
||||
download_remote_logs(options)
|
||||
parser.exit(0)
|
||||
|
||||
if not options.platform:
|
||||
if not options.platform and 'ghprbPullId' not in os.environ:
|
||||
parser.exit('--platform is required')
|
||||
|
||||
if not options.provider:
|
||||
if not options.provider and 'ghprbPullId' not in os.environ:
|
||||
parser.exit('--provider is required')
|
||||
|
||||
if options.echo_parseable_environment:
|
||||
echo_parseable_environment(options)
|
||||
parser.exit(0)
|
||||
|
||||
if not options.commit:
|
||||
if not options.commit and 'ghprbPullId' not in os.environ:
|
||||
parser.exit('--commit is required')
|
||||
|
||||
return options
|
||||
|
Loading…
Reference in New Issue
Block a user