This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu@ubuntu-xenial:~/craton$ sudo tox -e functional | |
functional create: /home/ubuntu/craton/.tox/functional | |
functional installdeps: -r/home/ubuntu/craton/test-requirements.txt | |
functional develop-inst: /home/ubuntu/craton | |
functional installed: The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.,alabaster==0.7.9,alembic==0.8.10,aniso8601==1.2.0,appdirs==1.4.0,automaton==1.7.0,Babel==2.3.4,cachetools==2.0.0,click==6.7,contextlib2==0.5.4,-e git+http://github.com/openstack/craton.git@de87a6bd9db5f5b084792b4b2f8cf274c06f5d9c#egg=craton,debtcollector==1.11.0,decorator==4.0.11,docker-py==1.10.6,docker-pycreds==0.2.1,docutils==0.12,extras==1.0.0,fasteners==0.14.1,fixtures==3.0.0,flake8==2.5.5,Flask==0.12,Flask-RESTful==0.3.5,futurist==0.21.0,iso8601==0.1.11,itsdangerous==0.24,Jinja2==2.9.5,jsonschema==2.5.1,kazoo==2.2.1,ke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker rm -f craton-api || true | |
docker build --pull -t craton-api:latest . | |
docker run -t --name craton-api -p 127.0.0.1:8080:8080 -d craton-api:latest | |
# wait until API server is available by probing it | |
until curl http://127.0.0.1:8080/v1/regions -H "Content-Type: application/json" -H "X-Auth-Token: demo" -H "X-Auth-User: demo" -H "X-Auth-Project: b9f10eca66ac4c279c139d01e65f96b4" | |
do | |
echo "Waiting for API server"; sleep 1 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(craton) ubuntu@ubuntu-xenial:~/craton/craton/common$ python t-policy-using-role-assignments.py | |
{ | |
"fleet:audit": "(role:admin or (principal:%(principal)s and role_:%(role_)s and resource:%(resource)s))" | |
} | |
Traceback (most recent call last): | |
File "t-policy-using-role-assignments.py", line 54, in <module> | |
ENF.register_defaults(rules) | |
File "/home/ubuntu/craton/lib/python3.5/site-packages/oslo_policy/policy.py", line 761, in register_defaults | |
self.register_default(default) | |
File "/home/ubuntu/craton/lib/python3.5/site-packages/oslo_policy/policy.py", line 747, in register_default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@syed-sample:~/craton# tox -e functional | |
functional develop-inst-noop: /root/craton | |
functional installed: alabaster==0.7.9,alembic==0.8.10,aniso8601==1.2.0,appdirs==1.4.0,automaton==1.7.0,Babel==2.3.4,cachetools==2.0.0,click==6.7,contextlib2==0.5.4,-e git+http://github.com/openstack/craton.git@1f11f58a00501487016abac6d792950000ab9b85#egg=craton,debtcollector==1.11.0,decorator==4.0.11,docker-py==1.10.6,docker-pycreds==0.2.1,docutils==0.12,extras==1.0.0,fasteners==0.14.1,fixtures==3.0.0,flake8==2.5.5,Flask==0.12,Flask-RESTful==0.3.5,futurist==0.21.0,iso8601==0.1.11,itsdangerous==0.24,Jinja2==2.8.1,jsonschema==2.5.1,kazoo==2.2.1,keystoneauth1==2.18.0,keystonemiddleware==4.14.0,linecache2==1.0.0,Mako==1.0.6,MarkupSafe==0.23,mccabe==0.4.0,mock==2.0.0,monotonic==1.2,mox3==0.20.0,msgpack-python==0.4.8,netaddr==0.7.19,netifaces==0.10.5,networkx==1.11,nose==1.3.7,os-client-config==1.26.0,oslo.config==3.22.0,oslo.context==2.11.0,oslo.db==4.17.0,oslo.i18n==3.12.0,oslo.log==3.20.0,oslo.middleware==3.23.0,oslo.seriali |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(craton) ubuntu@ubuntu-xenial:~/craton/craton/common$ python3.5 policy.py | |
{ | |
"example:get_http": "http:http://www.example.com", | |
"example:denied": "false:false", | |
"example:my_file": "(role:compute_admin or project_id:%(project_id)s)", | |
"example:lowercase_admin": "(role:admin or role:sysadmin)", | |
"example:early_and_fail": "(false:false and rule:true)", | |
"true": "", | |
"example:uppercase_admin": "(role:ADMIN or role:sysadmin)", | |
"example:allowed": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/craton/api/v1/resources/inventory/networks.py b/craton/api/v1/resources/inventory/networks.py | |
index 95632e0..cc505a1 100644 | |
--- a/craton/api/v1/resources/inventory/networks.py | |
+++ b/craton/api/v1/resources/inventory/networks.py | |
@@ -149,7 +149,7 @@ class NetDevicesVariables(base.Resource): | |
def get(self, id): | |
"""Get variables for the given network.""" | |
context = request.environ.get('context') | |
- obj = dbapi.netdevice_get_by_id(context, id) | |
+ obj = dbapi.netdevices_get_by_id(context, id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====================================================================== | |
ERROR: craton.tests.unit.test_api.APIV1NetInterfacesTest.test_get_netinterfaces_by_device_id | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/nose/case.py", line 134, in run | |
self.runTest(result) | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/nose/case.py", line 152, in runTest | |
test(result) | |
File "/home/ubuntu/craton/.tox/py35/lib/python3.5/site-packages/unittest2/case.py", line 673, in __call__ | |
return self.run(*args, **kwds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ 638 @mock.patch.object(dbapi, 'netdevices_get_by_id') | |
+ 639 def test_get_netdevices_get_by_id(self, mock_devices): | |
+ 640 ┆ mock_devices.return_value = fake_resources.NETDEVICE1 | |
+ 641 ┆ resp = self.get('/v1/netdevices/1') | |
+ 642 ┆ print (resp.json) | |
+ 643 ┆ self.assertEqual(resp.json["name"], fake_resources.NETDEVICE1.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[centos@syed-oneops vagrant-centos7]$ sudo cat /home/oneops/build/build-wf/log/jenkins.log | |
Running from: /home/oneops/build/build-wf/jenkins.war | |
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME") | |
Nov 14, 2016 7:51:48 PM winstone.Logger logInternal | |
INFO: Beginning extraction from war file | |
Nov 14, 2016 7:51:49 PM org.eclipse.jetty.util.log.JavaUtilLog info | |
INFO: jetty-winstone-2.9 | |
Nov 14, 2016 7:51:50 PM org.eclipse.jetty.util.log.JavaUtilLog info | |
INFO: NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet | |
Jenkins home directory: /home/oneops/build/build-wf found at: EnvVars.masterEnvVars.get("JENKINS_HOME") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DEFAULT] | |
# Set Debug level | |
debug=True | |
# Log file for craton inventory | |
log_file=craton-api.log | |
[api] | |
# Host IP to use for API service | |
host=0.0.0.0 | |
# Port to use for API service |
NewerOlder