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-01-22 16:34:20 +0100 |
commit | 105be007b4771dc108fb74ac589576a144b4e3af (patch) | |
tree | 9269678357a4cf958bdbf911a529ce015d708763 /src/pyfedpkg/__init__.py | |
parent | f786d564df7ed99d7a1464d4ba360392fd0bfc84 (diff) | |
download | fedora-packager-4/ndim-misc.tar.gz fedora-packager-4/ndim-misc.tar.xz fedora-packager-4/ndim-misc.zip |
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.
Diffstat (limited to 'src/pyfedpkg/__init__.py')
-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 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 |