gr360ry / dhcpawn Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
common dhcpStatements to show in configuration pages
for now, in a separate read-only view
to show hostname, status of dhcp and ldap services
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 = */*
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.