zulip package: Make check for provision failsafe.

It is not guaranteed that the integration scripts in
the Zulip repository even specify a `provision` option.
Therefore, checking the value of this option would fail.
Updating this with getattr and a default value.
This commit is contained in:
derAnfaenger 2017-09-12 11:02:29 +02:00 committed by Robert Hönig
parent cb770ffee9
commit c6e7ddfb03

View file

@ -228,7 +228,7 @@ def generate_option_group(parser, prefix=''):
def init_from_options(options, client=None): def init_from_options(options, client=None):
# type: (Any, Optional[str]) -> Client # type: (Any, Optional[str]) -> Client
if options.provision: if getattr(options, 'provision', False):
requirements_path = os.path.abspath(os.path.join(sys.path[0], 'requirements.txt')) requirements_path = os.path.abspath(os.path.join(sys.path[0], 'requirements.txt'))
try: try:
import pip import pip