class MBeanNotFoundError(Exception):
- def __init__(self, message, errors):
- super(MBeanNotFoundError, self).__init__(message)
+ def __init__(self, message, errors):
+ super(MBeanNotFoundError, self).__init__(message)
class BaseAppender(object):
def _get_index(self, connection, need_all=False):
indices = sorted([i for i in
- connection.indices.get_mapping().keys()
- if i.startswith('karaf')])
+ connection.indices.get_mapping().keys()
+ if i.startswith('karaf')])
if need_all:
return indices
else:
"""Represent and manipulate single IPv4 Addresses."""
def __init__(self, address):
-
"""
Args:
address: A string or integer representing the IP
Based on: http://stackoverflow.com/questions/10885238/
python-change-list-type-for-json-decoding"""
+
def __init__(self, **kwargs):
"""Initialize decoder with special array implementation."""
_json.JSONDecoder.__init__(self, **kwargs)
class Switch1(Topo):
"""Single switch s1 connected to n=2 hosts."""
+
def __init__(self):
Topo.__init__(self)
switch = self.addSwitch('s1')
class Switch2(Topo):
"""Single switch s2 connected to n=2 hosts."""
+
def __init__(self):
Topo.__init__(self)
switch = self.addSwitch('s2')
:param host_suffix: specified else default is 1. For example: if equals to 3 (s3,h3)
:param hosts_per_switch: Number of hosts be connected to the switch. Default is 1.
"""
+
def __init__(self, host_suffix=1, hosts_per_switch=1, **opts):
Topo.__init__(self, **opts)
switch = self.addSwitch('s%s' % host_suffix)
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
+ # The paper size ('letterpaper' or 'a4paper').
+ #'papersize': 'letterpaper',
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
+ # The font size ('10pt', '11pt' or '12pt').
+ #'pointsize': '10pt',
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
+ # Additional stuff for the LaTeX preamble.
+ #'preamble': '',
-# Latex figure (float) alignment
-#'figure_align': 'htbp',
+ # Latex figure (float) alignment
+ #'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# TODO: when autorelease starts publishing the dependencies.log artifact, this function (or the consumer
# of this tool) can take the latest dependencies.log from jenkins lastSuccessfulArtifacts and put it
# in /tmp/ For now the functionality to read the projects from that file are commented.
-
"""
projects = []
with open("/tmp/dependencies.log") as dep_file:
class CommandFailed(GitReviewException):
"""Command Failure Analysis"""
+
def __init__(self, *args):
Exception.__init__(self, *args)
(self.rc, self.output, self.argv, self.envp) = args
"counters": { <msg type>: count, ...}
"messages": { <msg type>: [hex_string1, ]}
"""
+
def __init__(self):
"""Thread safe dictionary init"""
super(ExaStorage, self).__init__()
self.prefix_count_to_add_default + 1)
s2_slots = ((self.remaining_prefixes_threshold - 1) /
(self.prefix_count_to_add_default -
- self.prefix_count_to_del_default) + 1)
+ self.prefix_count_to_del_default) + 1)
# S1_First_Index = 0
# S1_Last_Index = s1_slots * self.prefix_count_to_add_default - 1
s2_first_index = s1_slots * self.prefix_count_to_add_default
class Rpcs:
'''Handler for SimpleXMLRPCServer'''
+
def __init__(self, sendqueue, storage):
'''Init method
FlowConfigBlaster Statistics: a class that stores and further processes
statistics collected by Blaster worker threads during their execution.
"""
+
def __init__(self):
self.ok_rqst_rate = Counter(0.0)
self.total_rqst_rate = Counter(0.0)
Class to generate test URLs from the topology shard.
:return: List of generated Resources
"""
+
def __init__(self, host, port, auth):
TestUrlGenerator.__init__(self, host, port, auth)
self.resource_string = 'restconf/operational/network-topology:network-topology/topology/flow:1'
if (args.action not in _handler_matrix or
args.itemtype not in _handler_matrix[args.action]):
- msg = "Unsupported combination of action: " + str(args.action)
- msg += " and item: " + str(args.itemtype)
- logger.error(msg)
- raise NotImplementedError(msg)
+ msg = "Unsupported combination of action: " + str(args.action)
+ msg += " and item: " + str(args.itemtype)
+ logger.error(msg)
+ raise NotImplementedError(msg)
# TODO: need to filter out situations when we cannot use more items
# in one rest request (rpc or delete?)
return ovsdb_url
def add_vswitch_to_dict(self, vswitch_ip, vswitch_remote_ip, vswitch_ovsdb_port, vswitch_name):
-
""" Add details of an Open vSwitch instance to self.vswitch_dict
Args:
:param vswitch_ip: The ip of Open vSwitch to use