Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
/ pulp Public archive

Commit

Permalink
Fixes string comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlada Dusek committed Aug 7, 2018
1 parent b1f45aa commit 4c3b43a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugin/pulpcore/plugin/stages/declarative_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def __init__(self, first_stage, repository, sync_mode='mirror'):
Raises:
ValueError: if 'sync_mode' is passed an invalid value.
"""
if sync_mode is not 'mirror' and sync_mode is not 'additive':

if sync_mode != 'mirror' and sync_mode != 'additive':
msg = _("'sync_mode' must either be 'mirror' or 'additive' not '{sync_mode}'")
raise ValueError(msg.format(sync_mode=sync_mode))
self.first_stage = first_stage
Expand All @@ -106,9 +107,9 @@ def create(self):
QueryExistingContentUnits(), ContentUnitSaver(),
ContentUnitAssociation(new_version)
]
if self.sync_mode is 'additive':
if self.sync_mode == 'additive':
stages.append(EndStage())
elif self.sync_mode is 'mirror':
elif self.sync_mode == 'mirror':
stages.extend([ContentUnitUnassociation(new_version), EndStage()])
pipeline = create_pipeline(stages)
loop.run_until_complete(pipeline)

0 comments on commit 4c3b43a

Please sign in to comment.