Because repr() is not enough to escape ascii code or control code,
MsgBase.__str__() may collapse representation with binary data.
This patch add binary_str() in order to convert binary data into a
sequence of '\x00' style string.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch simplifies hex_array() and unifies its output into
'0x%02x' format.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch is generated by "2to3 -f dict" and irrevant parts were
hand-removed.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Deferred formatting to the logging system:
---------------------------------------------
In general
logger.debug('xxx %s yyy %d zzz' % (a, b, c))
can be written as:
logger.debug('xxx %s yyy %d %zzz', a, b, c)
This is faster, as Python logging doesn't bother doing the format
operation (which is slow) if the log message won't be logged.
We measured that a significant amount of CPU time in the BGP service
was attributable to these formatting operations.
Removed unneeded calls to str() and repr()
------------------------------------------
since formatting operations %s and %r will make these calls when
(and if) the formatting is performed.
Signed-off-by: Jerry Cen <zhiweic@google.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The parameter buf is an instance of bytearray, but Ryu tries to convert it as string,
and outputs the error messages as a result.
This patch fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
due to the way utils.import_module is implemented,
"ryu-manager ryu/app/switches.py" ends up with loading
switches.py module twice.
this commit fixes that by checking if module pathnames specified
on the command line is aliases of already loaded modules.
while the check is incomplete, it should cover the most of useful cases.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This trick is contained in oslo.config.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
make most of modules use openstack.common.cfg instead of gflags
caveats: no config file compatibility is provided. (flagfile vs ini file)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
You can run your Ryu applicaiton in the following way:
$ ryu-manager yourapp.py
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
To make the further integration into IaaS OSS (OpenStack and
CloudStack) easier, we switch to Apache 2.0 license.
ryu/app/wsapi.py is still under GPL3 or later. We replace it later.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>