Skip to content

Commit

Permalink
768243 - Error msg needs to be improved
Browse files Browse the repository at this point in the history
when manifest import failed with "409 conflict: import is older than existing data"
  • Loading branch information
Petr Chalupa committed Apr 10, 2012
1 parent 23835ef commit 2284c37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/src/katello/client/core/provider.py
Expand Up @@ -20,6 +20,7 @@
from urlparse import urlparse

from katello.client.api.provider import ProviderAPI
from katello.client.server import ServerRequestError
from katello.client.config import Config
from katello.client.core.base import Action, Command
from katello.client.core.utils import is_valid_record, get_abs_path, run_async_task_with_status, run_spinner_in_bg, AsyncTask, format_sync_errors
Expand Down Expand Up @@ -328,7 +329,12 @@ def run(self):

prov = get_provider(orgName, provName)
if prov != None:
response = run_spinner_in_bg(self.api.import_manifest, (prov["id"], f, force), message=_("Importing manifest, please wait... "))
try:
response = run_spinner_in_bg(self.api.import_manifest, (prov["id"], f, force), message=_("Importing manifest, please wait... "))
except ServerRequestError, re:
if re.args[0] == 400 and "displayMessage" in re.args[1] and re.args[1]["displayMessage"] == "Import is older than existing data":
re.args[1]["displayMessage"] = "Import is older then existing data, please try with --force option to import manifest."
raise re
f.close()
print response
return os.EX_OK
Expand Down

0 comments on commit 2284c37

Please sign in to comment.