Merge pull request #9680 from s0undt3ch/develop

Use the `__virtualname__` attribute
This commit is contained in:
Pedro Algarvio 2014-01-10 10:03:02 -08:00
commit 5b27a9a5c3
2 changed files with 7 additions and 4 deletions

View File

@ -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):

View File

@ -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