Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyloxi: parse unknown subclasses as the superclass #186

Merged
merged 1 commit into from
Jan 29, 2014

Conversation

rlane
Copy link
Contributor

@rlane rlane commented Jan 28, 2014

Reviewer: @andi-bigswitch

Previously we would throw an exception if we encountered a (for example)
experimenter action subclass that we didn't know existed. This was fine for
OFTest but causes problems for other tools that use pyloxi.

This change generates a full set of pack/unpack/pretty_print functions for
virtual classes. If a discriminator field contains a subtype we don't know
about, the "virtual" class is instantiated instead.

This also removes the special cases around unknown hello elements.

Previously we would throw an exception if we encountered a (for example)
experimenter action subclass that we didn't know existed. This was fine for
OFTest but causes problems for other tools that use pyloxi.

This change generates a full set of pack/unpack/pretty_print functions for
virtual classes. If a discriminator field contains a subtype we don't know
about, the virtual class is instantiated instead.

This also removes the special cases around unknown hello elements.
@@ -60,18 +60,6 @@ def test_version(self):
self.assertTrue(hasattr(loxi.of13, "message"))
self.assertTrue(hasattr(loxi.of13, "oxm"))

class TestCommon(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should maybe have a test_data case that validates handling of unknown hello_elems (though it would probably break Java at this point)

@andi-bigswitch
Copy link
Contributor

LGTM (btw it would be really neat if we had a 'pull request builder' that would publish the artifacts of a PR somewhere were they can easily be inspected.) We could probably put that into Jenkins...

ACK

@bsn-abat
Copy link

ABAT: START_MERGE: Log file at http://sbs2/abat/2014.01.29.0258-m.loxigen.master/abat.log

bsn-abat pushed a commit to floodlight/loxigen-artifacts that referenced this pull request Jan 29, 2014
Loxigen Head commit floodlight/loxigen@074f709
commit 074f7096e8fd4e7a63d2b9cbba68e60be9a87f31
Merge: f8498dd 038c9e6
Author: abat <abat@bigswitch.com>
Date:   Tue Jan 28 18:58:32 2014 -0800

    Merge into master from pull request #186:
    pyloxi: parse unknown subclasses as the superclass (floodlight/loxigen#186)

commit 038c9e6106e8756c1cd152bbbdc2ee75ffba7689
Author: Rich Lane <rlane@bigswitch.com>
Date:   Mon Jan 27 15:33:18 2014 -0800

    pyloxi: parse unknown subclasses as the superclass

    Previously we would throw an exception if we encountered a (for example)
    experimenter action subclass that we didn't know existed. This was fine for
    OFTest but causes problems for other tools that use pyloxi.

    This change generates a full set of pack/unpack/pretty_print functions for
    virtual classes. If a discriminator field contains a subtype we don't know
    about, the virtual class is instantiated instead.

    This also removes the special cases around unknown hello elements.
bsn-abat pushed a commit that referenced this pull request Jan 29, 2014
pyloxi: parse unknown subclasses as the superclass (#186)
@bsn-abat bsn-abat merged commit 038c9e6 into floodlight:master Jan 29, 2014
@bsn-abat
Copy link

ABAT: ACCEPT: Successfully merged

In case you want to see the build log, check out :
Log file at http://sbs2/abat/2014.01.29.0258-m.loxigen.master/abat.log
/cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants