Skip to content

Commit

Permalink
Fix windows/network instance persistence.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclay committed Oct 24, 2017
1 parent 67f9423 commit 575f604
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions test/runner/lib/core_ci.py
Expand Up @@ -36,13 +36,14 @@

class AnsibleCoreCI(object):
"""Client for Ansible Core CI services."""
def __init__(self, args, platform, version, stage='prod', persist=True, name=None):
def __init__(self, args, platform, version, stage='prod', persist=True, load=True, name=None):
"""
:type args: EnvironmentConfig
:type platform: str
:type version: str
:type stage: str
:type persist: bool
:type load: bool
:type name: str
"""
self.args = args
Expand Down Expand Up @@ -107,7 +108,7 @@ def __init__(self, args, platform, version, stage='prod', persist=True, name=Non

self.path = os.path.expanduser('~/.ansible/test/instances/%s-%s' % (self.name, self.stage))

if persist and self._load():
if persist and load and self._load():
try:
display.info('Checking existing %s/%s instance %s.' % (self.platform, self.version, self.instance_id),
verbosity=1)
Expand All @@ -126,7 +127,7 @@ def __init__(self, args, platform, version, stage='prod', persist=True, name=Non

self.instance_id = None
self.endpoint = None
else:
elif not persist:
self.instance_id = None
self.endpoint = None
self._clear()
Expand Down
4 changes: 2 additions & 2 deletions test/runner/lib/executor.py
Expand Up @@ -408,7 +408,7 @@ def network_run(args, platform, version, config):
:type config: dict[str, str]
:rtype: AnsibleCoreCI
"""
core_ci = AnsibleCoreCI(args, platform, version, stage=args.remote_stage, persist=False)
core_ci = AnsibleCoreCI(args, platform, version, stage=args.remote_stage, load=False)
core_ci.load(config)
core_ci.wait()

Expand Down Expand Up @@ -539,7 +539,7 @@ def windows_run(args, version, config):
:type config: dict[str, str]
:rtype: AnsibleCoreCI
"""
core_ci = AnsibleCoreCI(args, 'windows', version, stage=args.remote_stage, persist=False)
core_ci = AnsibleCoreCI(args, 'windows', version, stage=args.remote_stage, load=False)
core_ci.load(config)
core_ci.wait()

Expand Down

0 comments on commit 575f604

Please sign in to comment.