[PATCH v2] Implement %post --erroronfail

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH v2] Implement %post --erroronfail

Daniel Drake-5
This flag is documented and parsed, but not acted upon.
---
 imgcreate/creator.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 909f616..4deb49e 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -23,6 +23,7 @@ import sys
 import tempfile
 import shutil
 import logging
+import subprocess
 
 import selinux
 import yum
@@ -702,11 +703,17 @@ class ImageCreator(object):
                 script = "/tmp/" + os.path.basename(path)
 
             try:
-                subprocess.call([s.interp, script],
-                                preexec_fn = preexec, env = env)
+                subprocess.check_call([s.interp, script],
+                                      preexec_fn = preexec, env = env)
             except OSError, (err, msg):
                 raise CreatorError("Failed to execute %%post script "
                                    "with '%s' : %s" % (s.interp, msg))
+            except subprocess.CalledProcessError, err:
+                if s.errorOnFail:
+                    raise CreatorError("%%post script failed with code %d "
+                                       % err.returncode)
+                logging.warning("ignoring %%post failure (code %d)"
+                                % err.returncode)
             finally:
                 os.unlink(path)
 
--
1.6.2.5

--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2] Implement %post --erroronfail

Daniel Drake-5
On Thu, 2009-12-24 at 11:31 +0000, Daniel Drake wrote:
> This flag is documented and parsed, but not acted upon.

bump... Any further comments on this patch?

>  imgcreate/creator.py |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/imgcreate/creator.py b/imgcreate/creator.py
> index 909f616..4deb49e 100644
> --- a/imgcreate/creator.py
> +++ b/imgcreate/creator.py
> @@ -23,6 +23,7 @@ import sys
>  import tempfile
>  import shutil
>  import logging
> +import subprocess
>  
>  import selinux
>  import yum
> @@ -702,11 +703,17 @@ class ImageCreator(object):
>                  script = "/tmp/" + os.path.basename(path)
>  
>              try:
> -                subprocess.call([s.interp, script],
> -                                preexec_fn = preexec, env = env)
> +                subprocess.check_call([s.interp, script],
> +                                      preexec_fn = preexec, env = env)
>              except OSError, (err, msg):
>                  raise CreatorError("Failed to execute %%post script "
>                                     "with '%s' : %s" % (s.interp, msg))
> +            except subprocess.CalledProcessError, err:
> +                if s.errorOnFail:
> +                    raise CreatorError("%%post script failed with code %d "
> +                                       % err.returncode)
> +                logging.warning("ignoring %%post failure (code %d)"
> +                                % err.returncode)
>              finally:
>                  os.unlink(path)
>  

--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2] Implement %post --erroronfail

Daniel Drake-5
On 3 January 2010 10:39, Daniel Drake <[hidden email]> wrote:
> On Thu, 2009-12-24 at 11:31 +0000, Daniel Drake wrote:
>> This flag is documented and parsed, but not acted upon.
>
> bump... Any further comments on this patch?

bump...4 months on...can this be applied?

>>  imgcreate/creator.py |   11 +++++++++--
>>  1 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/imgcreate/creator.py b/imgcreate/creator.py
>> index 909f616..4deb49e 100644
>> --- a/imgcreate/creator.py
>> +++ b/imgcreate/creator.py
>> @@ -23,6 +23,7 @@ import sys
>>  import tempfile
>>  import shutil
>>  import logging
>> +import subprocess
>>
>>  import selinux
>>  import yum
>> @@ -702,11 +703,17 @@ class ImageCreator(object):
>>                  script = "/tmp/" + os.path.basename(path)
>>
>>              try:
>> -                subprocess.call([s.interp, script],
>> -                                preexec_fn = preexec, env = env)
>> +                subprocess.check_call([s.interp, script],
>> +                                      preexec_fn = preexec, env = env)
>>              except OSError, (err, msg):
>>                  raise CreatorError("Failed to execute %%post script "
>>                                     "with '%s' : %s" % (s.interp, msg))
>> +            except subprocess.CalledProcessError, err:
>> +                if s.errorOnFail:
>> +                    raise CreatorError("%%post script failed with code %d "
>> +                                       % err.returncode)
>> +                logging.warning("ignoring %%post failure (code %d)"
>> +                                % err.returncode)
>>              finally:
>>                  os.unlink(path)
>>
>
>
--
livecd mailing list
[hidden email]
https://admin.fedoraproject.org/mailman/listinfo/livecd
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2] Implement %post --erroronfail

Sebastian Dziallas
On Tue, May 4, 2010 at 5:13 PM, Daniel Drake <[hidden email]> wrote:
> On 3 January 2010 10:39, Daniel Drake <[hidden email]> wrote:
>> On Thu, 2009-12-24 at 11:31 +0000, Daniel Drake wrote:
>>> This flag is documented and parsed, but not acted upon.
>>
>> bump... Any further comments on this patch?
>
> bump...4 months on...can this be applied?

I'm a bit lost here.

There are probably five or more patches now waiting to be reviewed and
applied and even after CC'ing a couple of people who *do* definitely
have commit access according to FAS nothing has happened.

Ping?

--Sebastian

>>>  imgcreate/creator.py |   11 +++++++++--
>>>  1 files changed, 9 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/imgcreate/creator.py b/imgcreate/creator.py
>>> index 909f616..4deb49e 100644
>>> --- a/imgcreate/creator.py
>>> +++ b/imgcreate/creator.py
>>> @@ -23,6 +23,7 @@ import sys
>>>  import tempfile
>>>  import shutil
>>>  import logging
>>> +import subprocess
>>>
>>>  import selinux
>>>  import yum
>>> @@ -702,11 +703,17 @@ class ImageCreator(object):
>>>                  script = "/tmp/" + os.path.basename(path)
>>>
>>>              try:
>>> -                subprocess.call([s.interp, script],
>>> -                                preexec_fn = preexec, env = env)
>>> +                subprocess.check_call([s.interp, script],
>>> +                                      preexec_fn = preexec, env = env)
>>>              except OSError, (err, msg):
>>>                  raise CreatorError("Failed to execute %%post script "
>>>                                     "with '%s' : %s" % (s.interp, msg))
>>> +            except subprocess.CalledProcessError, err:
>>> +                if s.errorOnFail:
>>> +                    raise CreatorError("%%post script failed with code %d "
>>> +                                       % err.returncode)
>>> +                logging.warning("ignoring %%post failure (code %d)"
>>> +                                % err.returncode)
>>>              finally:
>>>                  os.unlink(path)
>>>
>>
>>
> --
> livecd mailing list
> [hidden email]
> https://admin.fedoraproject.org/mailman/listinfo/livecd
>
--
livecd mailing list
[hidden email]
https://admin.fedoraproject.org/mailman/listinfo/livecd
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2] Implement %post --erroronfail

Bruno Wolff III
On Wed, May 05, 2010 at 23:40:45 +0200,
  Sebastian Dziallas <[hidden email]> wrote:

> On Tue, May 4, 2010 at 5:13 PM, Daniel Drake <[hidden email]> wrote:
> > On 3 January 2010 10:39, Daniel Drake <[hidden email]> wrote:
> >> On Thu, 2009-12-24 at 11:31 +0000, Daniel Drake wrote:
> >>> This flag is documented and parsed, but not acted upon.
> >>
> >> bump... Any further comments on this patch?
> >
> > bump...4 months on...can this be applied?
>
> I'm a bit lost here.
>
> There are probably five or more patches now waiting to be reviewed and
> applied and even after CC'ing a couple of people who *do* definitely
> have commit access according to FAS nothing has happened.
>
> Ping?

I suspect that the issue has to do with Jeremy Katz no longer working for
Redhat. I think he still wants to work on things like this, but doesn't
have as much time. (That may not be an accurate understanding though.)

Probably someone else needs to step up to own livecd-tools. If you really
want to do this, you should be able to apply for membership in the group
that controls access.
--
livecd mailing list
[hidden email]
https://admin.fedoraproject.org/mailman/listinfo/livecd