public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] rewite-on-master patches round-3
@ 2013-12-14  3:28 Brian Dolbec
  2013-12-14  3:28 ` [gentoo-catalyst] [PATCH 1/3] Remove unused urllib import Brian Dolbec
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Brian Dolbec @ 2013-12-14  3:28 UTC (permalink / raw
  To: gentoo-catalyst


Some minor cleanup and 1 bugfix.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-catalyst] [PATCH 1/3] Remove unused urllib import.
  2013-12-14  3:28 [gentoo-catalyst] rewite-on-master patches round-3 Brian Dolbec
@ 2013-12-14  3:28 ` Brian Dolbec
  2013-12-14  3:28 ` [gentoo-catalyst] [PATCH 2/3] Remove unused variable new and an undefined variable s Brian Dolbec
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2013-12-14  3:28 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

This urllib import was added in commit 64c16cae70da13de3c55d8555a2e4c5dcdf2fcad
to fix an issue, but it is not used.  So must have covered up the real bug.  Removing it now
that I've completed some testing and haven't come across anything I can attribute to it.
---
 catalyst/support.py | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/catalyst/support.py b/catalyst/support.py
index 316dfa3..0ddf98d 100644
--- a/catalyst/support.py
+++ b/catalyst/support.py
@@ -18,10 +18,6 @@ except:
 # pids this process knows of.
 spawned_pids = []
 
-try:
-        import urllib
-except SystemExit, e:
-        raise
 
 def cleanup(pids,block_exceptions=True):
         """function to go through and reap the list of pids passed to it"""
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-catalyst] [PATCH 2/3] Remove unused variable new and an undefined variable s.
  2013-12-14  3:28 [gentoo-catalyst] rewite-on-master patches round-3 Brian Dolbec
  2013-12-14  3:28 ` [gentoo-catalyst] [PATCH 1/3] Remove unused urllib import Brian Dolbec
@ 2013-12-14  3:28 ` Brian Dolbec
  2013-12-14  3:28 ` [gentoo-catalyst] [PATCH 3/3] Fix undefined variable: RLIMIT_NOFILE Brian Dolbec
  2013-12-14  5:28 ` [gentoo-catalyst] rewite-on-master patches round-3 Matt Turner
  3 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2013-12-14  3:28 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

Commit b3475906d5f51a21ecaf4ff048002a2f44face52 introduced an
undefined variable "s".  The code must always be hitting the
general except: pass block.  Seems useless, if not maybe it'll
spit out a true error, so the real problem can be fixed.  Removed it all.
---
 catalyst/support.py | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/catalyst/support.py b/catalyst/support.py
index 0ddf98d..2133799 100644
--- a/catalyst/support.py
+++ b/catalyst/support.py
@@ -433,15 +433,7 @@ def spawn(mycommand,env={},raw_exit_code=False,opt_name=None,fd_pipes=None,retur
 				if trg_fd[x] == src_fd[x]:
 					continue
 				if trg_fd[x] in src_fd[x+1:]:
-					new=os.dup2(trg_fd[x],max(src_fd) + 1)
 					os.close(trg_fd[x])
-					try:
-						while True:
-							src_fd[s.index(trg_fd[x])]=new
-					except SystemExit, e:
-						raise
-					except:
-						pass
 
 			# transfer the fds to their final pre-exec position.
 			for x in range(0,len(trg_fd)):
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-catalyst] [PATCH 3/3] Fix undefined variable: RLIMIT_NOFILE
  2013-12-14  3:28 [gentoo-catalyst] rewite-on-master patches round-3 Brian Dolbec
  2013-12-14  3:28 ` [gentoo-catalyst] [PATCH 1/3] Remove unused urllib import Brian Dolbec
  2013-12-14  3:28 ` [gentoo-catalyst] [PATCH 2/3] Remove unused variable new and an undefined variable s Brian Dolbec
@ 2013-12-14  3:28 ` Brian Dolbec
  2013-12-14  5:28 ` [gentoo-catalyst] rewite-on-master patches round-3 Matt Turner
  3 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2013-12-14  3:28 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

It was not imported from resource, it was also not used correctly.
---
 catalyst/support.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/catalyst/support.py b/catalyst/support.py
index 2133799..072b985 100644
--- a/catalyst/support.py
+++ b/catalyst/support.py
@@ -6,14 +6,16 @@ selinux_capable = False
 #fakeroot_capable = False
 BASH_BINARY             = "/bin/bash"
 
+# set it to 0 for the soft limit, 1 for the hard limit
+DESIRED_RLIMIT = 0
 try:
-        import resource
-        max_fd_limit=resource.getrlimit(RLIMIT_NOFILE)
+	import resource
+	max_fd_limit=resource.getrlimit(resource.RLIMIT_NOFILE)[DESIRED_RLIMIT]
 except SystemExit, e:
-        raise
+	raise
 except:
-        # hokay, no resource module.
-        max_fd_limit=256
+	# hokay, no resource module.
+	max_fd_limit=256
 
 # pids this process knows of.
 spawned_pids = []
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [gentoo-catalyst] rewite-on-master patches round-3
  2013-12-14  3:28 [gentoo-catalyst] rewite-on-master patches round-3 Brian Dolbec
                   ` (2 preceding siblings ...)
  2013-12-14  3:28 ` [gentoo-catalyst] [PATCH 3/3] Fix undefined variable: RLIMIT_NOFILE Brian Dolbec
@ 2013-12-14  5:28 ` Matt Turner
  2013-12-14 23:53   ` W. Trevor King
  3 siblings, 1 reply; 6+ messages in thread
From: Matt Turner @ 2013-12-14  5:28 UTC (permalink / raw
  To: gentoo-catalyst

On Fri, Dec 13, 2013 at 7:28 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> Some minor cleanup and 1 bugfix.

These three look good to me, but it would be nice to have another set of eyes.

Reviewed-by: Matt Turner <mattst88@gentoo.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-catalyst] rewite-on-master patches round-3
  2013-12-14  5:28 ` [gentoo-catalyst] rewite-on-master patches round-3 Matt Turner
@ 2013-12-14 23:53   ` W. Trevor King
  0 siblings, 0 replies; 6+ messages in thread
From: W. Trevor King @ 2013-12-14 23:53 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

On Fri, Dec 13, 2013 at 09:28:14PM -0800, Matt Turner wrote:
> On Fri, Dec 13, 2013 at 7:28 PM, Brian Dolbec <dolsen@gentoo.org> wrote:
> > Some minor cleanup and 1 bugfix.
> 
> These three look good to me, but it would be nice to have another set of eyes.

Looks good to me too.

Reviewed-by: W. Trevor King <wking@tremily.us>

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-12-14 23:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-14  3:28 [gentoo-catalyst] rewite-on-master patches round-3 Brian Dolbec
2013-12-14  3:28 ` [gentoo-catalyst] [PATCH 1/3] Remove unused urllib import Brian Dolbec
2013-12-14  3:28 ` [gentoo-catalyst] [PATCH 2/3] Remove unused variable new and an undefined variable s Brian Dolbec
2013-12-14  3:28 ` [gentoo-catalyst] [PATCH 3/3] Fix undefined variable: RLIMIT_NOFILE Brian Dolbec
2013-12-14  5:28 ` [gentoo-catalyst] rewite-on-master patches round-3 Matt Turner
2013-12-14 23:53   ` W. Trevor King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox