From 3b09f3b8314262a2a7cd41c4cea9d8931c5de73f Mon Sep 17 00:00:00 2001 From: Roicxy Alonso Gonzalez Date: Tue, 7 May 2019 18:23:10 -0400 Subject: [PATCH 1/4] Deleted extra space before the __init__ method --- pyof/v0x05/common/header.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pyof/v0x05/common/header.py b/pyof/v0x05/common/header.py index 25670d46f..4a16e1767 100644 --- a/pyof/v0x05/common/header.py +++ b/pyof/v0x05/common/header.py @@ -108,7 +108,6 @@ class Header(GenericStruct): length = UBInt16() xid = UBInt32() - def __init__(self, message_type=None, length=None, xid=None): """Create a Header with the optional parameters below. From 58d87f561f631fa1ee6b93aca487d3899d414335 Mon Sep 17 00:00:00 2001 From: Roicxy Alonso Gonzalez Date: Tue, 7 May 2019 19:22:42 -0400 Subject: [PATCH 2/4] Fix some indentation and spaces in comments --- pyof/v0x05/common/header.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pyof/v0x05/common/header.py b/pyof/v0x05/common/header.py index 4a16e1767..d572bcf6d 100644 --- a/pyof/v0x05/common/header.py +++ b/pyof/v0x05/common/header.py @@ -60,9 +60,8 @@ class Type(IntEnum): # Queue Configuration messages # Controller/Switch message - #OFPT_QUEUE_GET_CONFIG_REQUEST = 22 - #OFPT_QUEUE_GET_CONFIG_REPLY = 23 - + # OFPT_QUEUE_GET_CONFIG_REQUEST = 22 + # OFPT_QUEUE_GET_CONFIG_REPLY = 23 # Controller role change request message # Controller/Switch message @@ -80,20 +79,20 @@ class Type(IntEnum): OFPT_METER_MOD = 29 - #Controller role change event messages - #Async message + # Controller role change event messages + # Async message OFPT_ROLE_STATUS = 30 - #Asynchronous message - #Async message + # Asynchronous message + # Async message OFPT_TABLE_STATUS = 31 - #Request forwarding by switch - #Async message + # Request forwarding by switch + # Async message OFPT_REQUESTFORWARD = 32 - #Bundle operations (Multiple messages as a single operation) - #Controller/Switch message + # Bundle operations (Multiple messages as a single operation) + # Controller/Switch message OFPT_BUNDLE_CONTROL = 33 OFPT_BUNDLE_ADD_MESSAGE = 34 From 81322f9ec497167841e7b4078ee32734ff414988 Mon Sep 17 00:00:00 2001 From: Roicxy Alonso Gonzalez Date: Tue, 7 May 2019 19:24:30 -0400 Subject: [PATCH 3/4] All indentation and spaces in Header files has been fix in relation to PEP8 --- pyof/v0x05/common/header.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pyof/v0x05/common/header.py b/pyof/v0x05/common/header.py index d572bcf6d..1acf849a5 100644 --- a/pyof/v0x05/common/header.py +++ b/pyof/v0x05/common/header.py @@ -78,7 +78,6 @@ class Type(IntEnum): # Controller/Switch message OFPT_METER_MOD = 29 - # Controller role change event messages # Async message OFPT_ROLE_STATUS = 30 From 6902c53430ee9ba294948c52e4ecc0e92f4c206a Mon Sep 17 00:00:00 2001 From: Roicxy Alonso Gonzalez Date: Tue, 7 May 2019 19:36:23 -0400 Subject: [PATCH 4/4] Eliminated the warnings in the hello file --- pyof/v0x05/symmetric/hello.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/pyof/v0x05/symmetric/hello.py b/pyof/v0x05/symmetric/hello.py index 392073b16..3a09d4176 100644 --- a/pyof/v0x05/symmetric/hello.py +++ b/pyof/v0x05/symmetric/hello.py @@ -2,8 +2,8 @@ # System imports -from pyof.foundation.base import GenericMessage, GenericStruct, IntEnum -from pyof.foundation.basic_types import BinaryData, FixedTypeList, UBInt16, UBInt32, TypeList +from pyof.foundation.base import GenericMessage, GenericStruct, Enum +from pyof.foundation.basic_types import BinaryData, FixedTypeList, UBInt16 from pyof.foundation.exceptions import PackException from pyof.v0x05.common.header import Header, Type @@ -14,7 +14,7 @@ # Enums -class HelloElemType(IntEnum): +class HelloElemType(Enum): """Hello element types.""" #: Bitmap of version supported. @@ -23,18 +23,16 @@ class HelloElemType(IntEnum): # Classes - class HelloElemHeader(GenericStruct): """Common header for all Hello Elements.""" - # One of OFPHET_*. type = UBInt16() # Length in bytes of element, including this header, excluding padding. length = UBInt16() # This variable does NOT appear in 1.4 specification # content = BinaryData() - def __init__(self, element_type=None, length=None, content=b''): + def __init__(self, element_type=None, length=None): """Create a HelloElemHeader with the optional parameters below. Args: @@ -109,7 +107,6 @@ def __init__(self, items=None): # super().append(items) - class Hello(GenericMessage): """OpenFlow Hello Message OFPT_HELLO. @@ -121,7 +118,6 @@ class Hello(GenericMessage): header = Header(Type.OFPT_HELLO) #: Hello element list - #: List of elements - 0 or more elements = ListOfHelloElements() def __init__(self, xid=None, elements=None): @@ -155,7 +151,3 @@ def __init__(self, length=None, bitmaps=None): """ super().__init__(HelloElemType.OFPHET_VERSIONBITMAP, length) self.bitmaps = bitmaps - - - -