Commit 2511d461 by Czémán Arnold

Fix flake8 warnings

parent ef5501a6
...@@ -17,4 +17,5 @@ def update_permissions_after_migration(sender, **kwargs): ...@@ -17,4 +17,5 @@ def update_permissions_after_migration(sender, **kwargs):
create_permissions(sender, apps.get_models(), 2 if settings.DEBUG else 0) create_permissions(sender, apps.get_models(), 2 if settings.DEBUG else 0)
post_migrate.connect(update_permissions_after_migration) post_migrate.connect(update_permissions_after_migration)
...@@ -171,6 +171,7 @@ class TemplateVms(object): ...@@ -171,6 +171,7 @@ class TemplateVms(object):
def get_minmax(self): def get_minmax(self):
return (0, None) return (0, None)
register_graph(TemplateVms, 'instances', TemplateGraphView) register_graph(TemplateVms, 'instances', TemplateGraphView)
...@@ -197,6 +198,7 @@ class Ram(object): ...@@ -197,6 +198,7 @@ class Ram(object):
def get_minmax(self): def get_minmax(self):
return (0, 105) return (0, 105)
register_graph(Ram, 'memory', VmGraphView) register_graph(Ram, 'memory', VmGraphView)
register_graph(Ram, 'memory', NodeGraphView) register_graph(Ram, 'memory', NodeGraphView)
...@@ -212,6 +214,7 @@ class Cpu(object): ...@@ -212,6 +214,7 @@ class Cpu(object):
else: else:
return (0, self.obj.num_cores * 100 + 5) return (0, self.obj.num_cores * 100 + 5)
register_graph(Cpu, 'cpu', VmGraphView) register_graph(Cpu, 'cpu', VmGraphView)
register_graph(Cpu, 'cpu', NodeGraphView) register_graph(Cpu, 'cpu', NodeGraphView)
...@@ -236,6 +239,7 @@ class VmNetwork(object): ...@@ -236,6 +239,7 @@ class VmNetwork(object):
params)) params))
return 'group(%s)' % ','.join(metrics) if metrics else None return 'group(%s)' % ','.join(metrics) if metrics else None
register_graph(VmNetwork, 'network', VmGraphView) register_graph(VmNetwork, 'network', VmGraphView)
...@@ -251,6 +255,7 @@ class NodeNetwork(object): ...@@ -251,6 +255,7 @@ class NodeNetwork(object):
'10), ".*\.bytes_(sent|recv)-([a-zA-Z0-9]+).*", "\\2 \\1")' % ( '10), ".*\.bytes_(sent|recv)-([a-zA-Z0-9]+).*", "\\2 \\1")' % (
self.obj.metric_prefix)) self.obj.metric_prefix))
register_graph(NodeNetwork, 'network', NodeGraphView) register_graph(NodeNetwork, 'network', NodeGraphView)
...@@ -262,6 +267,7 @@ class NodeVms(object): ...@@ -262,6 +267,7 @@ class NodeVms(object):
def get_minmax(self): def get_minmax(self):
return (0, None) return (0, None)
register_graph(NodeVms, 'vm', NodeGraphView) register_graph(NodeVms, 'vm', NodeGraphView)
...@@ -282,6 +288,7 @@ class NodeAllocated(object): ...@@ -282,6 +288,7 @@ class NodeAllocated(object):
def get_minmax(self): def get_minmax(self):
return (0, None) return (0, None)
register_graph(NodeAllocated, 'alloc', NodeGraphView) register_graph(NodeAllocated, 'alloc', NodeGraphView)
...@@ -302,6 +309,7 @@ class NodeListAllocated(object): ...@@ -302,6 +309,7 @@ class NodeListAllocated(object):
def get_minmax(self): def get_minmax(self):
return (0, None) return (0, None)
register_graph(NodeListAllocated, 'alloc', NodeListGraphView) register_graph(NodeListAllocated, 'alloc', NodeListGraphView)
...@@ -315,4 +323,5 @@ class NodeListVms(object): ...@@ -315,4 +323,5 @@ class NodeListVms(object):
def get_minmax(self): def get_minmax(self):
return (0, None) return (0, None)
register_graph(NodeListVms, 'vm', NodeListGraphView) register_graph(NodeListVms, 'vm', NodeListGraphView)
...@@ -143,6 +143,7 @@ class SwitchPortAdmin(admin.ModelAdmin): ...@@ -143,6 +143,7 @@ class SwitchPortAdmin(admin.ModelAdmin):
class EthernetDeviceAdmin(admin.ModelAdmin): class EthernetDeviceAdmin(admin.ModelAdmin):
list_display = ('name', ) list_display = ('name', )
admin.site.register(Host, HostAdmin) admin.site.register(Host, HostAdmin)
admin.site.register(Vlan, VlanAdmin) admin.site.register(Vlan, VlanAdmin)
admin.site.register(Rule, RuleAdmin) admin.site.register(Rule, RuleAdmin)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment