FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 06-02-2010, 07:59 PM
David Cantrell
 
Default Make parent directories for ks scriptlet log files (#597279)

Create parent directories for logfiles if they do not exist.
---
iutil.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/iutil.py b/iutil.py
index a568ff7..d0f6212 100644
--- a/iutil.py
+++ b/iutil.py
@@ -93,6 +93,9 @@ def execWithRedirect(command, argv, stdin = None, stdout = None,
stdin = sys.stdin.fileno()

if isinstance(stdout, str):
+ dn = os.path.dirname(os.path.realpath(stdout))
+ if not os.path.isdir(dn):
+ os.makedirs(dn)
stdout = os.open(stdout, os.O_RDWR|os.O_CREAT)
stdoutclose = lambda : os.close(stdout)
elif isinstance(stdout, int):
--
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-02-2010, 08:50 PM
Chris Lumens
 
Default Make parent directories for ks scriptlet log files (#597279)

> diff --git a/iutil.py b/iutil.py
> index a568ff7..d0f6212 100644
> --- a/iutil.py
> +++ b/iutil.py
> @@ -93,6 +93,9 @@ def execWithRedirect(command, argv, stdin = None, stdout = None,
> stdin = sys.stdin.fileno()
>
> if isinstance(stdout, str):
> + dn = os.path.dirname(os.path.realpath(stdout))
> + if not os.path.isdir(dn):
> + os.makedirs(dn)
> stdout = os.open(stdout, os.O_RDWR|os.O_CREAT)
> stdoutclose = lambda : os.close(stdout)
> elif isinstance(stdout, int):

I intended to fix this with s/basename/dirname on line 85 of
kickstart.py on master. When I was working on this feature, I spaced
out and used basename instead of dirname on that line. You got to the
bug first, but I think that's what should be done.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-14-2010, 06:10 PM
David Cantrell
 
Default Make parent directories for ks scriptlet log files (#597279)

On Wed, 2 Jun 2010, Chris Lumens wrote:


diff --git a/iutil.py b/iutil.py
index a568ff7..d0f6212 100644
--- a/iutil.py
+++ b/iutil.py
@@ -93,6 +93,9 @@ def execWithRedirect(command, argv, stdin = None, stdout = None,
stdin = sys.stdin.fileno()

if isinstance(stdout, str):
+ dn = os.path.dirname(os.path.realpath(stdout))
+ if not os.path.isdir(dn):
+ os.makedirs(dn)
stdout = os.open(stdout, os.O_RDWR|os.O_CREAT)
stdoutclose = lambda : os.close(stdout)
elif isinstance(stdout, int):


I intended to fix this with s/basename/dirname on line 85 of
kickstart.py on master. When I was working on this feature, I spaced
out and used basename instead of dirname on that line. You got to the
bug first, but I think that's what should be done.



Yeah, that makes more sense. Done.

--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 04:37 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org