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 > ArchLinux > ArchLinux User Repository

 
 
LinkBack Thread Tools
 
Old 04-11-2012, 08:50 AM
Martin Gracik
 
Default Remove workdir if it was created by lorax (#807964)

---
src/pylorax/__init__.py | 10 ++++++++--
src/sbin/lorax | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
index ef0a1c0..042f21d 100644
--- a/src/pylorax/__init__.py
+++ b/src/pylorax/__init__.py
@@ -129,7 +129,8 @@ class Lorax(BaseLoraxClass):
logger.addHandler(fh)

def run(self, ybo, product, version, release, variant="", bugurl="",
- isfinal=False, workdir=None, outputdir=None, buildarch=None, volid=None):
+ isfinal=False, workdir=None, outputdir=None, buildarch=None, volid=None
+ remove_temp=False):

assert self._configured

@@ -139,7 +140,7 @@ class Lorax(BaseLoraxClass):
os.makedirs(self.workdir)

# set up log directory
- logdir = joinpaths(self.workdir, "log")
+ logdir = '/var/log/lorax'
if not os.path.isdir(logdir):
os.makedirs(logdir)

@@ -262,6 +263,11 @@ class Lorax(BaseLoraxClass):
treeinfo.add_section(section, data)
treeinfo.write(joinpaths(self.outputdir, ".treeinfo"))

+ # cleanup
+ if remove_temp:
+ remove(self.workdir)
+
+
def get_buildarch(ybo):
# get architecture of the available anaconda package
buildarch = None
diff --git a/src/sbin/lorax b/src/sbin/lorax
index 5b93b96..31b8df1 100755
--- a/src/sbin/lorax
+++ b/src/sbin/lorax
@@ -126,7 +126,7 @@ def main(args):
lorax.run(yb, opts.product, opts.version, opts.release,
opts.variant, opts.bugurl, opts.isfinal,
workdir=tempdir, outputdir=outputdir, buildarch=opts.buildarch,
- volid=opts.volid)
+ volid=opts.volid, remove_temp=True)


def get_yum_base_object(installroot, repositories, mirrorlists=[],
--
1.7.5.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-12-2012, 11:47 AM
Radek Vykydal
 
Default Remove workdir if it was created by lorax (#807964)

On 04/11/2012 10:50 AM, Martin Gracik wrote:

---
src/pylorax/__init__.py | 10 ++++++++--
src/sbin/lorax | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
index ef0a1c0..042f21d 100644
--- a/src/pylorax/__init__.py
+++ b/src/pylorax/__init__.py
@@ -129,7 +129,8 @@ class Lorax(BaseLoraxClass):
logger.addHandler(fh)

def run(self, ybo, product, version, release, variant="", bugurl="",
- isfinal=False, workdir=None, outputdir=None, buildarch=None, volid=None):
+ isfinal=False, workdir=None, outputdir=None, buildarch=None, volid=None


Missing comma at the end of the line, other than that - ack.


+ remove_temp=False):

assert self._configured



_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-12-2012, 12:10 PM
Martin Gracik
 
Default Remove workdir if it was created by lorax (#807964)

that's a nice catch, thanks

----- Original Message -----
> On 04/11/2012 10:50 AM, Martin Gracik wrote:
> > ---
> > src/pylorax/__init__.py | 10 ++++++++--
> > src/sbin/lorax | 2 +-
> > 2 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
> > index ef0a1c0..042f21d 100644
> > --- a/src/pylorax/__init__.py
> > +++ b/src/pylorax/__init__.py
> > @@ -129,7 +129,8 @@ class Lorax(BaseLoraxClass):
> > logger.addHandler(fh)
> >
> > def run(self, ybo, product, version, release, variant="",
> > bugurl="",
> > - isfinal=False, workdir=None, outputdir=None,
> > buildarch=None, volid=None):
> > + isfinal=False, workdir=None, outputdir=None,
> > buildarch=None, volid=None
>
> Missing comma at the end of the line, other than that - ack.
>
> > + remove_temp=False):
> >
> > assert self._configured
> >
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
>

_______________________________________________
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 01:05 AM.

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