diff --git a/netrino/__init__.py b/netrino/__init__.py index 3830d33..65d6a5c 100644 --- a/netrino/__init__.py +++ b/netrino/__init__.py @@ -28,4 +28,3 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # THE POSSIBILITY OF SUCH DAMAGE. -from netrino.core.register import Register diff --git a/netrino/core/register.py b/netrino/core/register.py deleted file mode 100644 index 41fd0b2..0000000 --- a/netrino/core/register.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2018 Christiaan Frans Rademan. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# * Neither the name of the copyright holders nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -# THE POSSIBILITY OF SUCH DAMAGE. -import traceback - -from luxon import g -from luxon.core.logger import GetLogger - -log = GetLogger(__name__) - - -class Register(object): - __slots__ = () - - def discover(self, name): - pass - - def element(self, name): - pass - - def interface(self, name): - pass diff --git a/netrino/interfaces/__init__.py b/netrino/interfaces/__init__.py index 9268193..e69de29 100644 --- a/netrino/interfaces/__init__.py +++ b/netrino/interfaces/__init__.py @@ -1 +0,0 @@ -from netrino.interfaces import netconf diff --git a/netrino/interfaces/netconf/discover.py b/netrino/interfaces/netconf/discover.py index 2db40c5..0a8b0fe 100644 --- a/netrino/interfaces/netconf/discover.py +++ b/netrino/interfaces/netconf/discover.py @@ -28,10 +28,6 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # THE POSSIBILITY OF SUCH DAMAGE. -from netrino import register - - -@register.discover('netconf') def discover(ip): pass diff --git a/netrino/interfaces/netconf/element.py b/netrino/interfaces/netconf/element.py index 3fa6fd6..a2ad774 100644 --- a/netrino/interfaces/netconf/element.py +++ b/netrino/interfaces/netconf/element.py @@ -32,10 +32,7 @@ from luxon import Model from luxon.utils.timezone import now -from netrino import register - -@register.element('netconf') class Element(Model): id = Model.Uuid(default=uuid4, internal=True) ip = Model.String(null=False) diff --git a/netrino/interfaces/netconf/interface.py b/netrino/interfaces/netconf/interface.py index 2b8c782..37cfe15 100644 --- a/netrino/interfaces/netconf/interface.py +++ b/netrino/interfaces/netconf/interface.py @@ -28,13 +28,10 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # THE POSSIBILITY OF SUCH DAMAGE. -from netrino import register - - -@register.interface('netconf') class Interface(object): def edit_config(self, uuid, payload): # step 1 use function to get creds etc from uuid # step 2 pass to ncclient # return response + pass diff --git a/setup.py b/setup.py index ab8a067..03d7a9b 100644 --- a/setup.py +++ b/setup.py @@ -281,7 +281,17 @@ def run(self): cmdclass=cmdclass, ext_modules=ext_modules, zip_safe=False, # don't use eggs - # entry_points={ + entry_points={ + 'netrino_discover': [ + 'netconf = netrino.interfaces.netconf.discover:discover' + ], + 'netrino_interfaces': [ + 'netconf = netrino.interfaces.netconf.interface:Interface' + ], + 'netrino_elements': [ + 'netconf = netrino.interfaces.netconf.element:Element' + ], + } # 'console_scripts': [ # 'netrino = netrino.main:entry_point' # ],