Description of problem: spacewalk-repo-sync does not exit appropriately in case of failure. There are two main issues: --- the exit code is always 0 if not options.channel_label: systemExit(1, "--channel must be specified") sync = reposync.RepoSync(channel_label=options.channel_label, repo_type=options.repo_type, url=options.url, fail=options.fail, quiet=options.quiet, filters=options.filters, no_errata=options.no_errata, sync_kickstart=options.sync_kickstart) sync.sync() releaseLOCK() return 0 --- YumRepo Last Sync and Last Modified are Updated. except Exception, e: self.error_msg("ERROR: %s" % e) if plugin is not None: plugin.clear_ssl_cache() if self.regen: taskomatic.add_to_repodata_queue_for_channel_package_subscription( [self.channel_label], [], "server.app.yumreposync") taskomatic.add_to_erratacache_queue(self.channel_label) self.update_date() rhnSQL.commit() Version-Release number of selected component (if applicable): spacewalk-backend-tools-1.9.46-23 How reproducible: 100% Steps to Reproduce: 1. Create a Custom Software Channel - test_test. 2. Create Repository with fake url. 3. Add the Repository to Channel. 4. Create python script like: #!/usr/bin/python import sys, xmlrpclib, re, getopt RHN_SERVER='https://test.redhat.com/rpc/api' RHN_USER='test' RHN_PASS='test' client = xmlrpclib.Server(RHN_SERVER, verbose=0) key = client.auth.login(RHN_USER, RHN_PASS) client.channel.software.getDetails(key,'test_test') res=client.channel.software.getDetails(key,'test_test') print "YumRepo Last Sync %s" % res['yumrepo_last_sync'] print "Last Modified %s" % res['last_modified'] 5. Execute the script. 4. On CLI execute: spacewalk-repo-sync -c test_test 5. Execute the script. Actual results: #./test.py YumRepo Last Sync 20130718T04:04:17 Last Modified 20130718T04:04:17 # spacewalk-repo-sync -c test_test Repo URL: file:///root/sp-repo-sync-local-config-file/test_repo_11 ERROR: Cannot retrieve repository metadata (repomd.xml) for repository: test_test. Please verify its path and try again Sync completed. Total time: 0:00:00 # ./test.py YumRepo Last Sync 20130718T04:15:05 Last Modified 20130718T04:15:05 YumRepo Last Sync and Last Modified are Updated. Expected results: YumRepo Last Sync and Last Modified should not be Updated. Additional info:
Not a regression.