Gentoo Archives: gentoo-catalyst

From: Brian Dolbec <dolsen@g.o>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] [PATCH] support: delete unused code
Date: Wed, 07 Oct 2015 02:32:13
Message-Id: 20151006193118.56226664.dolsen@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH] support: delete unused code by Mike Frysinger
1 On Tue, 6 Oct 2015 17:45:07 -0400
2 Mike Frysinger <vapier@g.o> wrote:
3
4 > Using the vulture tool (and verifying a bit with `git grep`),
5 > delete various bits of code from this module that aren't used.
6 > ---
7 > catalyst/support.py | 28 ----------------------------
8 > 1 file changed, 28 deletions(-)
9 >
10 > diff --git a/catalyst/support.py b/catalyst/support.py
11 > index f184ed7..62be63a 100644
12 > --- a/catalyst/support.py
13 > +++ b/catalyst/support.py
14 > @@ -1,7 +1,6 @@
15 >
16 > import glob
17 > import sys
18 > -import string # pylint: disable=deprecated-module
19 > import os
20 > import types
21 > import re
22 > @@ -11,35 +10,8 @@ from subprocess import Popen
23 >
24 > from catalyst.defaults import verbosity, valid_config_file_values
25 >
26 > -selinux_capable = False
27 > -#userpriv_capable = (os.getuid() == 0)
28 > -#fakeroot_capable = False
29 > -
30 > BASH_BINARY = "/bin/bash"
31 >
32 > -# set it to 0 for the soft limit, 1 for the hard limit
33 > -DESIRED_RLIMIT = 0
34 > -try:
35 > - import resource
36 > -
37 > max_fd_limit=resource.getrlimit(resource.RLIMIT_NOFILE)[DESIRED_RLIMIT]
38 > -except Exception:
39 > - # hokay, no resource module.
40 > - max_fd_limit=256
41 > -
42
43
44 Are you sure this is not needed? Because I recall having to fix the
45 code because the API had changed, otherwise I couldn't get catalyst to
46 run. But to be honest, catalyst is the only place I've seen this ever
47 used. And so it is likely not needed.
48
49
50 > -# pids this process knows of.
51 > -spawned_pids = []
52 > -
53 > -
54 > -# a function to turn a string of non-printable characters
55 > -# into a string of hex characters
56 > -def hexify(s):
57 > - hexStr = string.hexdigits
58 > - r = ''
59 > - for ch in s:
60 > - i = ord(ch)
61 > - r = r + hexStr[(i >> 4) & 0xF] + hexStr[i & 0xF]
62 > - return r
63 > -
64 >
65 > def read_from_clst(path):
66 > line = ''
67
68
69
70 --
71 Brian Dolbec <dolsen>

Replies

Subject Author
Re: [gentoo-catalyst] [PATCH] support: delete unused code Mike Frysinger <vapier@g.o>