Code Monkey home page Code Monkey logo

monolithe's People

Contributors

brncoguz avatar chaitanyahalbe avatar chris-serafin avatar dsamaey avatar gitter-badger avatar killanch avatar little-dude avatar martin-leclerc avatar mboyerm avatar natabal avatar paquel avatar pdellaert avatar pdumais avatar primalmotion avatar rbjbrooks avatar siebeclaes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

monolithe's Issues

support for inheritance in specifications

It would be nice instead of assuming that creationDate, owner etc are default bambou attributes, we could create a specification that is inherited.

I suggest that we could add some specifications prefixed by a symbol
@vsdobject.spec

The repo parsers would ignore those prefixed specifications when building the object model.

Then in standard specifications we could add in the model section an attribute extends: vsdobject

When a parser gets a spec, it would look for this token, then fetch the inherited specification, in order to correctly compute the Specification object.

It should also not difficult to allow multiple inheritence.

subnet.spec extends @vsdobject.spec extends @restobject.spec

Freshly created VSPK fails to start

Clean environment with only basic python-pip installed, running the following commands to install vspk:

mkdir GitHub
cd GitHub
git clone https://github.com/nuagenetworks/vspkgenerator.git
git clone https://github.com/nuagenetworks/vsd-api-specifications.git
git clone https://github.com/nuagenetworks/bambou.git
git clone https://github.com/nuagenetworks/monolithe.git
cd bambou/
pyhton setup.py install 
cd ../monolithe
python setup.py install
cd ../vspkgenerator
python setup.py install
cd ..
generate-vspk -b 3.2 -f vsd-api-specifications
cd codegen
python setup.py install

When executing the following code:

from vspk import v3_2 as vsdk
nc = vsdk.NUVSDSession(username='csproot', password='csproot', enterprise='csp', api_url="https://10.167.43.48:8443")
nc.start()

Results in the following exception thrown (output from inside ipython):

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-17836de9e772> in <module>()
----> 1 nc.start()

/usr/lib/python2.7/site-packages/bambou-2.0.0-py2.7.egg/bambou/nurest_session.pyc in start(self)
    169         else:
    170             _NURESTSessionCurrentContext.session = self
--> 171             self._authenticate()
    172             return self
    173

/usr/lib/python2.7/site-packages/bambou-2.0.0-py2.7.egg/bambou/nurest_session.pyc in _authenticate(self)
    138
    139         if self._root_object is None:
--> 140             self._root_object = self.create_root_object()
    141             self._root_object.fetch()
    142

/usr/lib/python2.7/site-packages/vspk-3.2.4-py2.7.egg/vspk/v3_2/nuvsdsession.pyc in create_root_object(self)
     76
     77         """
---> 78         return NUMe()
     79
     80

/usr/lib/python2.7/site-packages/vspk-3.2.4-py2.7.egg/vspk/v3_2/nume.pyc in __init__(self, **kwargs)
    279
    280
--> 281         self.vsps = NUVSPsFetcher.fetcher_with_object(parent_object=self, relationship="root")
    282
    283

TypeError: fetcher_with_object() got an unexpected keyword argument 'relationship'

Failed to run example

  • OS: ubuntu 16.04
  • Python 2.7.11 & pip: 8.1.2

When I tried to run

./examples/demo-client.py

I got

Traceback (most recent call last):
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "/home/jennings/test-dev/monolithe/examples/demo-server.py", line 21, in get_lists
if not lib.check_auth(request):
File "/home/jennings/test-dev/monolithe/examples/minilib/lib.py", line 13, in check_auth
decoded_auth = base64.urlsafe_b64decode(str(encoded_auth))
File "/usr/lib/python2.7/base64.py", line 119, in urlsafe_b64decode
"""
File "/home/jennings/.local/lib/python2.7/site-packages/future/types/newstr.py", line 390, in translate
if ord(c) in table:
TypeError: 'in ' requires string as left operand, not int

And all seem to go back to normal after deleting the from builtins import * lines in example/minilib/lib.py & example/minilib/data.py.

MANIFEST.in not complete causing vspk-generator error

When installing all the components from the GitHub repositories (clone bambou, monolithe, vspkgenerator and vsd-api-specifications, pyton setup.py install for bambou, monolithe, vspkgenerator) and using the vspkgenerator fails:

# generate-vspk -f /root/GitHub/vsd-api-specifications  -b 3.2
[log] retrieving specifications from folder "/root/GitHub/vsd-api-specifications"
[log] 130 specifications retrieved from folder "/root/GitHub/vsd-api-specifications" (api version: 3.2)
Traceback (most recent call last):
  File "/bin/monogen-sdk", line 9, in <module>
    load_entry_point('monolithe==1.0.0', 'console_scripts', 'monogen-sdk')()
  File "/usr/lib/python2.7/site-packages/monolithe-1.0.0-py2.7.egg/monolithe/generators/sdk/cli.py", line 146, in main
    generator.generate_from_folder()
  File "/usr/lib/python2.7/site-packages/monolithe-1.0.0-py2.7.egg/monolithe/generators/lib/generator.py", line 68, in generate_from_folder
    self.generate(specification_info=specification_info)
  File "/usr/lib/python2.7/site-packages/monolithe-1.0.0-py2.7.egg/monolithe/generators/sdk/sdkgenerator.py", line 68, in generate
    self.install_system_vanilla(current_file=__file__, output_path=sdk_output)
  File "/usr/lib/python2.7/site-packages/monolithe-1.0.0-py2.7.egg/monolithe/generators/lib/generator.py", line 121, in install_system_vanilla
    shutil.copytree(system_vanilla_path, output_path)
  File "/usr/lib64/python2.7/shutil.py", line 171, in copytree
    names = os.listdir(src)
OSError: [Errno 2] No such file or directory: '/usr/lib/python2.7/site-packages/monolithe-1.0.0-py2.7.egg/monolithe/generators/sdk/python/vanilla'

The source of the error is the change in the monolithe/generators/sdk folder which is not reflected in the MANIFEST.in file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.