summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2011-01-22 16:34:20 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2011-01-22 16:34:20 +0100
commit105be007b4771dc108fb74ac589576a144b4e3af (patch)
tree9269678357a4cf958bdbf911a529ce015d708763
parentf786d564df7ed99d7a1464d4ba360392fd0bfc84 (diff)
downloadfedora-packager-4/ndim-misc.zip
fedora-packager-4/ndim-misc.tar.gz
fedora-packager-4/ndim-misc.tar.xz
Have PackageModule require a path4/ndim-misc
The definition of the --path argument to fedpkg in parse_cmdline() already makes os.getcwd() the default value for args.path. Thus, we can get rid of the code providing the very same default for the path in PackageModule.__init__(). Also, make sure the path actually exists and is a directory.
-rw-r--r--src/pyfedpkg/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 5c3afcd..e04191a 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -1032,12 +1032,12 @@ class PackageModule:
return subprocess.Popen(['rpm --eval %{_arch}'], shell=True,
stdout=subprocess.PIPE).communicate()[0].strip('\n')
- def __init__(self, path=None):
+ def __init__(self, path):
# Initiate a PackageModule object in a given path
# Set some global variables used throughout
- if not path:
- path = os.getcwd()
log.debug('Creating module object from %s' % path)
+ if not os.path.isdir(path):
+ raise FedpkgError('Module directory not found: %s' % path)
self.path = path
self.lookaside = LOOKASIDE
self.lookasidehash = LOOKASIDEHASH