diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2011-01-22 16:34:20 +0100 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2011-02-05 01:24:12 +0100 |
commit | 4526d5b713fb36e30e79784b8f1182e6062b45b0 (patch) | |
tree | 869b0358bbc263add8518b65950d5d86006ee74a | |
parent | 67cb4cd783f2ac7dd78801b495d73bbeafd4462e (diff) | |
download | fedora-packager-5/ndim-misc.tar.gz fedora-packager-5/ndim-misc.tar.xz fedora-packager-5/ndim-misc.zip |
Have PackageModule require a path5/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__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 78e2b2e..edcbbd8 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1070,12 +1070,12 @@ class PackageModule: return subprocess.Popen(['rpm --eval %{_arch}'], shell=True, stdout=subprocess.PIPE).communicate()[0].strip('\n') - def __init__(self, path=None, dist=None): + def __init__(self, path, dist=None): # 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 |