ajenti / ajenti

Unused variable found PYL-W0612
Anti-pattern
Major
6 months ago4 years old
Unused variable 'e'
148def detect_platform_string():
149    try:
150        return subprocess.check_output(['lsb_release', '-sd']).strip().decode()
151    except subprocess.CalledProcessError as e:152        return subprocess.check_output(['uname', '-mrs']).strip().decode()
153    except FileNotFoundError:
154        logging.warning('Please install lsb_release to detect the platform!')
Unused variable 'e'
132    if dist == '':
133        try:
134            dist = subprocess.check_output(['strings', '-4', '/etc/issue']).split()[0].strip().decode()
135        except subprocess.CalledProcessError as e:136            dist = 'unknown'
137
138    res = dist.strip(' \'"\t\n\r').lower()
Unused variable 'err'
132            ])
133            child.sendline(password)
134            result = child.expect(['su: .*', 'SUCCESS'])
135        except pexpect.exceptions.EOF as err:136            logging.error(f'Login error: {child.before.decode().strip()}')
137            if child and child.isalive():
138                child.close()
 20        self.message = message or str(inner)
 21        try:
 22            self.traceback_str = traceback.format_exc()
 23        except Exception as e: 24            self.traceback_str = None
 25
 26    def __str__(self):
Unused variable 'e'
26            else:
27                # Trying with default paths
28                subprocess.check_output(['ajenti-upgrade'])
29        except FileNotFoundError as e:30            subprocess.check_output(['/usr/local/bin/ajenti-upgrade'])
31
32