Sites could specify a path in the user's home directory for the kojiconfig attribute (e.g. ~/.koji/config-cbs). This is a one-line change to run os.expanduser() on that path so that file doesn't get skipped when loading the koji session attributes.
Brian
-- Brian Stinson bstinson@ksu.edu | IRC: bstinson | Bitbucket/Twitter: bstinsonmhk
--- src/pyrpkg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pyrpkg/__init__.py b/src/pyrpkg/__init__.py index 6961d5e..8403763 100644 --- a/src/pyrpkg/__init__.py +++ b/src/pyrpkg/__init__.py @@ -199,7 +199,7 @@ class Commands(object): 'topurl': None } # Process the configs in order, global, user, then any option passed - for configfile in (self.kojiconfig, + for configfile in (os.path.expanduser(self.kojiconfig), os.path.expanduser('~/.koji/config')): try: f = open(configfile)
On Thu, 2014-10-09 at 21:59 +0000, Brian Stinson wrote:
src/pyrpkg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pyrpkg/__init__.py b/src/pyrpkg/__init__.py index 6961d5e..8403763 100644 --- a/src/pyrpkg/__init__.py +++ b/src/pyrpkg/__init__.py @@ -199,7 +199,7 @@ class Commands(object): 'topurl': None } # Process the configs in order, global, user, then any option passed
for configfile in (self.kojiconfig,
for configfile in (os.path.expanduser(self.kojiconfig),
If you expand it when it is used, you'll eventually need to expand it in other places, as it might get used elsewhere.
Why not instead expanding it where it gets defined?
- self.kojiconfig = kojiconfig + self.kojiconfig = os.path.expanduser(kojiconfig)
This way, all subsequent usage of it is already correct. :)
On Oct 10 09:16, Mathieu Bridon wrote:
On Thu, 2014-10-09 at 21:59 +0000, Brian Stinson wrote:
src/pyrpkg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pyrpkg/__init__.py b/src/pyrpkg/__init__.py index 6961d5e..8403763 100644 --- a/src/pyrpkg/__init__.py +++ b/src/pyrpkg/__init__.py @@ -199,7 +199,7 @@ class Commands(object): 'topurl': None } # Process the configs in order, global, user, then any option passed
for configfile in (self.kojiconfig,
for configfile in (os.path.expanduser(self.kojiconfig),
If you expand it when it is used, you'll eventually need to expand it in other places, as it might get used elsewhere.
Why not instead expanding it where it gets defined?
self.kojiconfig = kojiconfig
self.kojiconfig = os.path.expanduser(kojiconfig)
This way, all subsequent usage of it is already correct. :)
-- Mathieu
-- buildsys mailing list buildsys@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/buildsys
That definitely makes more sense than what I have :)
Brian
-- Brian Stinson bstinson@ksu.edu | IRC: bstinson | Bitbucket/Twitter: bstinsonmhk
--- src/pyrpkg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pyrpkg/__init__.py b/src/pyrpkg/__init__.py index 57d187e..f951327 100644 --- a/src/pyrpkg/__init__.py +++ b/src/pyrpkg/__init__.py @@ -90,7 +90,7 @@ class Commands(object): # The regex of branches we care about self.branchre = branchre # The location of the buildsys config file - self.kojiconfig = kojiconfig + self.kojiconfig = os.path.expanduser(kojiconfig) # The buildsys client to use self.build_client = build_client # A way to override the discovered "distribution"
Applied and pushed upstream. Thanks!
On 10/16/2014 02:00 AM, Brian Stinson wrote:
src/pyrpkg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pyrpkg/__init__.py b/src/pyrpkg/__init__.py index 57d187e..f951327 100644 --- a/src/pyrpkg/__init__.py +++ b/src/pyrpkg/__init__.py @@ -90,7 +90,7 @@ class Commands(object): # The regex of branches we care about self.branchre = branchre # The location of the buildsys config file
self.kojiconfig = kojiconfig
self.kojiconfig = os.path.expanduser(kojiconfig) # The buildsys client to use self.build_client = build_client # A way to override the discovered "distribution"
buildsys@lists.fedoraproject.org