1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-24 17:16:12 +01:00

Fix %(apihost)s in "build-root" option for osc chroot

Prevents a crash in osc chroot when %(apihost)s is defined in the
"build-root" config option.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
This commit is contained in:
Markus Lehtonen 2012-05-03 13:40:32 +03:00 committed by Adrian Schröter
parent 1fd7eda7c3
commit 68670a7a83

View File

@ -9,6 +9,7 @@ import conf
import oscerr import oscerr
import sys import sys
import time import time
import urlparse
from optparse import SUPPRESS_HELP from optparse import SUPPRESS_HELP
@ -5404,8 +5405,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
package = os.path.splitext(descr)[0] package = os.path.splitext(descr)[0]
else: else:
package = store_read_package('.') package = store_read_package('.')
apihost = urlparse.urlsplit(self.get_api_url())[1]
buildroot = os.environ.get('OSC_BUILD_ROOT', conf.config['build-root']) \ buildroot = os.environ.get('OSC_BUILD_ROOT', conf.config['build-root']) \
% {'repo': repository, 'arch': arch, 'project': project, 'package': package} % {'repo': repository, 'arch': arch, 'project': project, 'package': package, 'apihost': apihost}
if not os.path.isdir(buildroot): if not os.path.isdir(buildroot):
raise oscerr.OscIOError(None, '\'%s\' is not a directory' % buildroot) raise oscerr.OscIOError(None, '\'%s\' is not a directory' % buildroot)