Skip to content

Commit

Permalink
Exit as failure when tap is running or not enabled (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
koszti authored Oct 2, 2020
1 parent 64a19fe commit dfb8544
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pipelinewise/cli/pipelinewise.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,14 +898,14 @@ def run_tap(self):

# Run only if tap enabled
if not self.tap.get('enabled', False):
self.logger.info('Tap %s is not enabled. Do nothing and exit normally.', self.tap['name'])
sys.exit(0)
self.logger.info('Tap %s is not enabled.', self.tap['name'])
sys.exit(1)

# Run only if not running
tap_status = self.detect_tap_status(target_id, tap_id)
if tap_status['currentStatus'] == 'running':
self.logger.info('Tap %s is currently running. Do nothing and exit normally.', self.tap['name'])
sys.exit(0)
self.logger.info('Tap %s is currently running.', self.tap['name'])
sys.exit(1)

# Generate and run the command to run the tap directly
tap_config = self.tap['files']['config']
Expand Down Expand Up @@ -1051,8 +1051,8 @@ def sync_tables(self):

# Run only if tap enabled
if not self.tap.get('enabled', False):
self.logger.info('Tap %s is not enabled. Do nothing and exit normally.', self.tap['name'])
sys.exit(0)
self.logger.info('Tap %s is not enabled.', self.tap['name'])
sys.exit(1)

# Run only if tap not running
tap_status = self.detect_tap_status(target_id, tap_id)
Expand Down

0 comments on commit dfb8544

Please sign in to comment.