Coder Social home page Coder Social logo

dhcpawn's People

Contributors

mvasilkov avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mvasilkov

dhcpawn's Issues

Initial Deployment fails on Mac

Ansible TASK: [webapp | migrate db] - Fails with the below error:

TASK: [webapp | bootstrap] ****************************************************
changed: [dhcpsrv]

TASK: [webapp | ensure private config] ****************************************
changed: [dhcpsrv]

TASK: [webapp | migrate db] ***************************************************
failed: [dhcpsrv] => {"changed": true, "cmd": "cd /opt/dhcpawn && python manage.py db upgrade", "delta": "0:00:00.402363", "end": "2015-04-18 15:16:41.058795", "rc": 1, "start": "2015-04-18 15:16:40.656432", "warnings": []}
stderr: [2015-04-18 15:16:40.927250] INFO: Generic: Started
Traceback (most recent call last):
  File "manage.py", line 192, in <module>
    cli()
  File "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/click/core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/click/core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "/opt/dhcpawn/_lib/bootstrapping.py", line 21, in new_func
    return func(*args, **kwargs)
  File "/opt/dhcpawn/_lib/db.py", line 87, in upgrade
    with _migrate_context() as migrate:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/opt/dhcpawn/_lib/db.py", line 93, in _migrate_context
    from flask_app.app import app
  File "/opt/dhcpawn/flask_app/app.py", line 48, in <module>
    from . import models
  File "/opt/dhcpawn/flask_app/models.py", line 4, in <module>
    from sqlalchemy_utils import IPAddressType
ImportError: No module named sqlalchemy_utils

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/Users/gregs/site.retry

dhcpsrv                    : ok=57   changed=47   unreachable=0    failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
Traceback (most recent call last):
  File "manage.py", line 192, in <module>
    cli()
  File "/Users/gregs/dev/dhcpawn/.env/lib/python2.7/site-packages/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/Users/gregs/dev/dhcpawn/.env/lib/python2.7/site-packages/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/Users/gregs/dev/dhcpawn/.env/lib/python2.7/site-packages/click/core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/gregs/dev/dhcpawn/.env/lib/python2.7/site-packages/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/gregs/dev/dhcpawn/.env/lib/python2.7/site-packages/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "manage.py", line 76, in deploy
    _run_deploy(dest)
  File "manage.py", line 88, in _run_deploy
    subprocess.check_call('vagrant up', shell=True, env=environ)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'vagrant up' returned non-zero exit status 1

Access to API following the installation is broken

Following the vagrant deployment, basic api test results in error:

curl http://localhost:10080/api/hosts/

Output below:

uWSGI exceptions catcher for "GET /api/hosts/" (request plugin: "python", modifier1: 0)

Exception: sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) column host.options does not exist
LINE 1: ....mac AS host_mac, host.group_id AS host_group_id, host.optio...
                                                             ^
 [SQL: 'SELECT host.id AS host_id, host.name AS host_name, host.mac AS host_mac, host.group_id AS host_group_id, host.options AS host_options \nFROM host']

Exception class: sqlalchemy.exc.ProgrammingError

Exception message: (psycopg2.ProgrammingError) column host.options does not exist
LINE 1: ....mac AS host_mac, host.group_id AS host_group_id, host.optio...
                                                             ^
 [SQL: 'SELECT host.id AS host_id, host.name AS host_name, host.mac AS host_mac, host.group_id AS host_group_id, host.options AS host_options \nFROM host']

Backtrace:
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/flask/app.py" line: 1836 function: "__call__" text/code: "return self.wsgi_app(environ, start_response)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/flask/app.py" line: 1820 function: "wsgi_app" text/code: "response = self.make_response(self.handle_exception(e))"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/flask/app.py" line: 1403 function: "handle_exception" text/code: "reraise(exc_type, exc_value, tb)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/flask/app.py" line: 1817 function: "wsgi_app" text/code: "response = self.full_dispatch_request()"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/flask/app.py" line: 1477 function: "full_dispatch_request" text/code: "rv = self.handle_user_exception(e)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/flask/app.py" line: 1381 function: "handle_user_exception" text/code: "reraise(exc_type, exc_value, tb)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/flask/app.py" line: 1475 function: "full_dispatch_request" text/code: "rv = self.dispatch_request()"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/flask/app.py" line: 1461 function: "dispatch_request" text/code: "return self.view_functions[rule.endpoint](**req.view_args)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/flask/views.py" line: 84 function: "view" text/code: "return self.dispatch_request(*args, **kwargs)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/flask/views.py" line: 149 function: "dispatch_request" text/code: "return meth(*args, **kwargs)"
filename: "/opt/dhcpawn/flask_app/methodviews.py" line: 30 function: "get" text/code: "hosts = Host.query.all()"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py" line: 2398 function: "all" text/code: "return list(self)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py" line: 2515 function: "__iter__" text/code: "return self._execute_and_instances(context)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py" line: 2530 function: "_execute_and_instances" text/code: "result = conn.execute(querycontext.statement, self._params)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py" line: 914 function: "execute" text/code: "return meth(self, multiparams, params)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py" line: 323 function: "_execute_on_connection" text/code: "return connection._execute_clauseelement(self, multiparams, params)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py" line: 1010 function: "_execute_clauseelement" text/code: "compiled_sql, distilled_params"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py" line: 1146 function: "_execute_context" text/code: "context)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py" line: 1332 function: "_handle_dbapi_exception" text/code: "exc_info"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py" line: 199 function: "raise_from_cause" text/code: "reraise(type(exception), exception, tb=exc_tb)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py" line: 1139 function: "_execute_context" text/code: "context)"
filename: "/opt/dhcpawn/.env/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py" line: 442 function: "do_execute" text/code: "cursor.execute(statement, parameters)"


QUERY_STRING =
REQUEST_METHOD = GET
CONTENT_TYPE =
CONTENT_LENGTH =
REQUEST_URI = /api/hosts/
PATH_INFO = /api/hosts/
DOCUMENT_ROOT = /usr/share/nginx/html
SERVER_PROTOCOL = HTTP/1.1
REMOTE_ADDR = 10.0.2.2
REMOTE_PORT = 52172
SERVER_PORT = 80
SERVER_NAME =
HTTP_USER_AGENT = curl/7.37.1
HTTP_HOST = localhost:10080
HTTP_ACCEPT = */*

Subnet verification

implement a feature to check that ip/range is within subnet cn + netmask, as:

IPs must be contained in the subnet to be statically allocated.

Ranges must be contained in the subnet if they are children/attributes of the subnet

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.