ajenti / ajenti

Attribute defined outside __init__ PYL-W0201
Anti-pattern
Minor
6 months ago4 years old
Attribute 'iptables' defined outside __init__
17    @endpoint(api=True)
18    def handle_api_get_which_iptables(self, http_context):
19        try:
20            self.iptables = subprocess.check_output(['which', 'iptables']).decode().strip()21        except subprocess.CalledProcessError as e:
22            raise EndpointError(_('Iptables is not installed on this host'))
23
Attribute 'fstab_config' defined outside __init__
 88        :rtype: dict in load mode
 89        """
 90
 91        self.fstab_config = FSTabConfig(path='/etc/fstab') 92        self.fstab_config.load()
 93        return self.fstab_config.tree.to_dict()
 94
Attribute 'done' defined outside __init__
 83                progress_callback(message=message, done=self.current_items, total=self.total_items)
 84
 85            def stop(self):
 86                self.done = True 87
 88        cache = apt.Cache()
 89        ack = Progress()