Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.

Re-pulling image error should exit 0#997

Closed
baude wants to merge 1 commit intoprojectatomic:masterfrom
baude:pull_repeat
Closed

Re-pulling image error should exit 0#997
baude wants to merge 1 commit intoprojectatomic:masterfrom
baude:pull_repeat

Conversation

@baude
Copy link
Member

@baude baude commented May 8, 2017

Description

Bugzilla #1430708 recommends that if an atomic user attempts to pull
an image that is already present, we should not exit with a '1' which
indicates a failure; rather a 0.

Related Bugzillas

  • Bugzilla #1430708

Related Issue Numbers

Pull Request Checklist:

If your Pull request contains new features or functions, tests are required. If the PR is a bug fix and no tests exist, please consider adding some to prevent regressions.

  • Unittests
  • Integration Tests

if local_image is not None:
if self.already_has_image(local_image, remote_image_obj):
raise ValueError("Latest version of {} already present.".format(image))
util.write_err("Latest version of {} already present.".format(image))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create an exception that handles this, rather then writing the code here.

Something like

raise SuccessException("Latest version of {} already present.".format(image))

That way it could be handled potentially by something like atomic-dbus or other callers.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm misunderstanding the desired end game here, but I thought you'd just replace the old 'raise ValueError' call here with a 'return 0' then let the self_inspect fire in the update call as a double (triple) check.

@TomSweeneyRedHat
Copy link

There's a comment near line 400 where the self.pull_image is called from that will need to be tweaked based on the final change.

Bugzilla #1430708 recommends that if an atomic user attempts to pull
an image that is already present, we should not exit with a '1' which
indicates a failure; rather a 0.
@baude
Copy link
Member Author

baude commented May 12, 2017

@rh-atomic-bot r+ 46dc65e

@rh-atomic-bot
Copy link

⌛ Testing commit 46dc65e with merge 77ef28f...

@baude
Copy link
Member Author

baude commented May 12, 2017

Merging so I can cut a new release of Atomic.

@rh-atomic-bot
Copy link

☀️ Test successful - status-redhatci
Approved by: baude
Pushing 77ef28f to master...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants