Commit 651c5d8c authored by Antoine Millet's avatar Antoine Millet
Browse files

PEP8

parent bfdd59db
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ class NodeConfigParser(object):
                    'Configuration attribute "verbosity"'
                    ' is invalid (section "node")')


        self.debug = config.getboolean('node', 'debug', False)
        self.logging_output = 'console' if self.debug else 'syslog'

+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ from cloudcontrol.common.jobs import JobsManagerInterface, Job, JobCancelError
from cloudcontrol.common.tql.db.helpers import taggify
from cloudcontrol.common.client.tags import TagDB, Tag


class NodeJobsManagerInterface(JobsManagerInterface):

    TAG_ATTRIBUTES = ('title', 'status', 'state', 'owner', 'created', 'ended',
@@ -42,6 +43,7 @@ class NodeJobsManagerInterface(JobsManagerInterface):
             for tag in self.TAG_ATTRIBUTES),
            'job',
        )

        def tag_duration(job):
            if job.ended is None:
                ended = datetime.fromtimestamp(self.handler.main.evloop.now())
+1 −0
Original line number Diff line number Diff line
@@ -188,5 +188,6 @@ def load():
        pass
    return load_


def plugins(handler):
    return ' '.join(handler.plugins) or None
+1 −4
Original line number Diff line number Diff line
@@ -267,8 +267,7 @@ class Handler(HostHandler):
        except libvirt.libvirtError as exc:
            # Libvirt raises exception 'domain is not running' even if domain
            # is running, might be a bug in libvirt
            if 'domain is not running' not in str(exc) or (
                self.hypervisor.domains[name].state != 'running'):
            if 'domain is not running' not in str(exc) or (self.hypervisor.domains[name].state != 'running'):
                logger.exception('Error while destroying VM %s', name)
                raise
        except KeyError:
@@ -449,7 +448,6 @@ class Handler(HostHandler):
        # update autostart value now instead of 10 seconds lag
        vm.tag_db['__main__']['autostart'].update_value()


    @libvirt_handler
    def tag_add(self, name, tag, value):
        """Add a static tag on specified VM.
@@ -483,7 +481,6 @@ class Handler(HostHandler):
        vm = self.hypervisor.domains[name]
        return vm.tags


    @libvirt_handler
    def vol_create(self, pool, name, size):
        logger.debug('Volume create %s, pool %s, size %s', name, pool, size)
+1 −2
Original line number Diff line number Diff line
@@ -84,8 +84,7 @@ class VirtualMachine(object):
                Tag('disk%s_path' % i, v.path, 10),
                Tag('disk%s_pool' % i, v.storage, 10),  # FIXME: change
                Tag('disk%s_vol' % i, v.name, 10),
                Tag('disk%s_cache' %i,
                    lambda: self.cache_behaviour.get(v.path), 10)
                Tag('disk%s_cache' % i, lambda: self.cache_behaviour.get(v.path), 10)
            ):
                self.tag_db.add_tag(t)

Loading