summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-09-21 21:18:40 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-09-21 21:18:40 +0900
commit448ebe99e9dc42f62bc1cc9b2e49228c9a2b6a61 (patch)
tree04ed18e3a89446db82ff99122d02967165c24aa3
parent95ae3c7211b5ef46d26de27706bbf29c3300bfbe (diff)
bgp: python3 fixes
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/services/protocols/bgp/base.py2
-rw-r--r--ryu/services/protocols/bgp/rtconf/base.py9
-rw-r--r--ryu/services/protocols/bgp/utils/circlist.py2
-rw-r--r--ryu/services/protocols/bgp/utils/internable.py1
4 files changed, 7 insertions, 7 deletions
diff --git a/ryu/services/protocols/bgp/base.py b/ryu/services/protocols/bgp/base.py
index aac0fe60..ed662d01 100644
--- a/ryu/services/protocols/bgp/base.py
+++ b/ryu/services/protocols/bgp/base.py
@@ -528,7 +528,7 @@ def validate(**kwargs):
If name is not provided we use function name as name of the validator.
"""
def decorator(func):
- _VALIDATORS[kwargs.pop('name', func.func_name)] = func
+ _VALIDATORS[kwargs.pop('name', func.__name__)] = func
return func
return decorator
diff --git a/ryu/services/protocols/bgp/rtconf/base.py b/ryu/services/protocols/bgp/rtconf/base.py
index 5925e6ed..eb195436 100644
--- a/ryu/services/protocols/bgp/rtconf/base.py
+++ b/ryu/services/protocols/bgp/rtconf/base.py
@@ -21,9 +21,6 @@ from abc import abstractmethod
import numbers
import logging
import uuid
-from types import BooleanType
-from types import IntType
-from types import LongType
from ryu.services.protocols.bgp.base import add_bgp_error_metadata
from ryu.services.protocols.bgp.base import BGPSException
@@ -645,7 +642,7 @@ def validate_cap_rtc_as(rtc_as):
@validate(name=HOLD_TIME)
def validate_hold_time(hold_time):
- if ((hold_time is None) or (not isinstance(hold_time, IntType)) or
+ if ((hold_time is None) or (not isinstance(hold_time, int)) or
hold_time < 10):
raise ConfigValueError(desc='Invalid hold_time configuration value %s'
% hold_time)
@@ -681,7 +678,7 @@ def validate_soo_list(soo_list):
@validate(name=MAX_PREFIXES)
def validate_max_prefixes(max_prefixes):
- if not isinstance(max_prefixes, (IntType, LongType)):
+ if not isinstance(max_prefixes, (IntType, long)):
raise ConfigTypeError(desc='Max. prefixes value should be of type '
'int or long but found %s' % type(max_prefixes))
if max_prefixes < 0:
@@ -692,7 +689,7 @@ def validate_max_prefixes(max_prefixes):
@validate(name=ADVERTISE_PEER_AS)
def validate_advertise_peer_as(advertise_peer_as):
- if not isinstance(advertise_peer_as, BooleanType):
+ if not isinstance(advertise_peer_as, bool):
raise ConfigTypeError(desc='Invalid type for advertise-peer-as, '
'expected bool got %s' %
type(advertise_peer_as))
diff --git a/ryu/services/protocols/bgp/utils/circlist.py b/ryu/services/protocols/bgp/utils/circlist.py
index df92ff77..d22ec215 100644
--- a/ryu/services/protocols/bgp/utils/circlist.py
+++ b/ryu/services/protocols/bgp/utils/circlist.py
@@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from six.moves import intern
+
class CircularListType(object):
"""Instances of this class represent a specific type of list.
diff --git a/ryu/services/protocols/bgp/utils/internable.py b/ryu/services/protocols/bgp/utils/internable.py
index ae39798c..9f5e8d95 100644
--- a/ryu/services/protocols/bgp/utils/internable.py
+++ b/ryu/services/protocols/bgp/utils/internable.py
@@ -14,6 +14,7 @@
# limitations under the License.
import weakref
+from six.moves import intern
dict_name = intern('_internable_dict')