[openstack-dev] [Congress] Magnum_driver
Hi everybody, I've added the magnum_driver code, that I'm trying to write for congress, to review. I think that I've made some errors. I hope in your help. Ruben __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
[openstack-dev] [Congress] Magnum_driver
Hi everybody, first of all: Tim thanks for your help. I've read the code in python-magnumclient/magnumclient/v1/cluster_templates_shell.py and in python-magnumclient/magnumclient/v1/clusters_shell.py, so I've modify the translators in the magnum_driver according to _show_cluster_template(cluster_template) and _show_cluster(cluster) methods shown in these files. Are these the methods to be taken into account for the translation? Anyway I don't know if I made mistakes in the translation.. I've some doubts because if I made the CLI command 'magnum cluster-template-list' I have: +--+--+ | uuid | name | +--+--+ | 8d25a1ed-faa6-4305-a6a1-6559708c805b | k8s-cluster-template | +--+--+ and if I made the CLI command 'magnum cluster-template-show k8s-cluster-template' I have: +---+--+ | Property | Value| +---+--+ | insecure_registry | -| | labels| {} | | updated_at| -| | floating_ip_enabled | True | | fixed_subnet | -| | master_flavor_id | my | | uuid | 8d25a1ed-faa6-4305-a6a1-6559708c805b | | no_proxy | -| | https_proxy | -| | tls_disabled | False| | keypair_id| testkey | | public| False| | http_proxy| -| | docker_volume_size| 7| | server_type | vm | | external_network_id | public | | cluster_distro| fedora-atomic| | image_id | fedora-atomic-latest | | volume_driver | -| | registry_enabled | False| | docker_storage_driver | devicemapper | | apiserver_port| -| | name | k8s-cluster-template | | created_at| 2016-11-11T11:38:25+00:00| | network_driver| flannel | | fixed_network | -| | coe | kubernetes | | flavor_id | m1.tiny | | master_lb_enabled | False| | dns_nameserver| 193.205.160.3| +---+--+ So fields that I see here are a litte bit different from fields in the methods above mentioned. Same thing for cluster. 'magnum cluster-list' +--+-+++--+---+ | uuid | name| keypair_id | node_count | master_count | status| +--+-+++--+---+ | 1634beb9-25de-4cdd-bafa-67537069f0cc | k8s-cluster | testkey| 1 | 1| CREATE_FAILED | +--+-+++--+---+ 'magnum cluster-show k8s-cluster' +-++ | Property| Value
[openstack-dev] [Congress] Magnum_driver
Hi everybody, As suggested by Tim I've checked what JSON data magnum is returning on the CLI by adding the --debug parameter to the magnum CLI commands. magnum --debug cluster-template-list RESP BODY: {"clustertemplates": [{"insecure_registry": null, "links": [{"href": "http://10.0.2.15:9511/v1/clustertemplates/8d25a1ed-faa6-4305-a6a1-6559708c805b";, "rel": "self"}, {"href": "http://10.0.2.15:9511/clustertemplates/8d25a1ed-faa6-4305-a6a1-6559708c805b";, "rel": "bookmark"}], "http_proxy": null, "updated_at": null, "floating_ip_enabled": true, "fixed_subnet": null, "master_flavor_id": "my", "uuid": "8d25a1ed-faa6-4305-a6a1-6559708c805b", "no_proxy": null, "https_proxy": null, "tls_disabled": false, "keypair_id": "testkey", "public": false, "labels": {}, "docker_volume_size": 7, "server_type": "vm", "external_network_id": "public", "cluster_distro": "fedora-atomic", "image_id": "fedora-atomic-latest", "volume_driver": null, "registry_enabled": false, "docker_storage_driver": "devicemapper", "apiserver_port": null, "name": "k8s-cluster-template", "created_at": "2016-11-11T11:38:25+00:00", "network_driver": "flannel", "fixed_network": null, "coe": "kubernetes", "flavor_id": "m 1.tiny", "master_lb_enabled": false, "dns_nameserver": "193.205.160.3"}]} magnum --debug cluster-list RESP BODY: {"clusters": [{"status": "CREATE_FAILED", "cluster_template_id": "8d25a1ed-faa6-4305-a6a1-6559708c805b", "uuid": "1634beb9-25de-4cdd-bafa-67537069f0cc", "links": [{"href": "http://10.0.2.15:9511/v1/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc";, "rel": "self"}, {"href": "http://10.0.2.15:9511/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc";, "rel": "bookmark"}], "stack_id": "17f1248d-286a-4fd4-9639-af5773670f03", "keypair": "testkey", "master_count": 1, "node_count": 1, "create_timeout": 60, "name": "k8s-cluster"}]} I've modified the magnum_driver and the unit test for it, but I still have some errors. Anyway, I've added the magnum_driver code and its unit test to review. Ruben __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
[openstack-dev] [Congress] Magnum_driver
Hi everybody, I've trying to run the unit test of the magnum_driver. I make: -cd /opt/stack/congress/ -tox -epy27 but I have error with the import. This is the output: "py27 develop-inst-noop: /opt/stack/congress py27 installed: alabaster==0.7.9,alembic==0.8.8,amqp==1.4.9,anyjson==0.3.3,appdirs==1.4.0,Babel==2.3.4,cachetools==2.0.0,cffi==1.9.1,cliff==2.2.0,cmd2==0.6.9,-e git+http://git.openstack.org/openstack/congress@b2d96b56f721c941e85db565d203df008c455b19#egg=congress,contextlib2==0.5.4,coverage==4.2,cryptography==1.5.3,debtcollector==1.9.0,decorator==4.0.10,docutils==0.12,dogpile.cache==0.6.2,enum34==1.1.6,eventlet==0.19.0,extras==1.0.0,fasteners==0.14.1,fixtures==3.0.0,flake8==2.2.4,funcsigs==1.0.2,functools32==3.2.3.post2,futures==3.0.5,futurist==0.19.0,greenlet==0.4.10,hacking==0.10.2,idna==2.1,ipaddress==1.0.17,iso8601==0.1.11,Jinja2==2.8,jsonpatch==1.14,jsonpointer==1.10,jsonschema==2.5.1,keystoneauth1==2.15.0,keystonemiddleware==4.10.0,kombu==3.0.37,linecache2==1.0.0,lxml==3.6.4,Mako==1.0.6,MarkupSafe==0.23,mccabe==0.2.1,mock==2.0.0,monotonic==1.2,mox3==0.18.0,msgpack-python==0.4.8,netaddr==0.7.18,netifaces==0.10.5,openstacksdk==0.9.9,os-client-config==1.22.0,osc-lib==1.2.0,oslo.con currency==3.15.0,oslo.config==3.19.0,oslo.context==2.10.0,oslo.db==4.14.0,oslo.i18n==3.10.0,oslo.log==3.17.0,oslo.messaging==5.12.0,oslo.middleware==3.20.0,oslo.policy==1.16.0,oslo.serialization==2.14.0,oslo.service==1.17.0,oslo.utils==3.18.0,oslo.vmware==2.15.0,oslosphinx==4.8.0,oslotest==2.11.0,Paste==2.0.3,PasteDeploy==1.5.2,pbr==1.10.0,pep8==1.5.7,pika==0.10.0,pika-pool==0.1.3,ply==3.9,positional==1.1.1,prettytable==0.7.2,PuLP==1.6.1,pyasn1==0.1.9,pycadf==2.4.0,pycparser==2.17,pyflakes==0.8.1,Pygments==2.1.3,pyinotify==0.9.6,pyOpenSSL==16.2.0,pyparsing==1.5.7,python-ceilometerclient==2.7.0,python-cinderclient==1.9.0,python-dateutil==2.6.0,python-editor==1.0.1,python-glanceclient==2.5.0,python-heatclient==1.5.0,python-ironicclient==1.8.0,python-keystoneclient==3.6.0,python-mimeparse==1.6.0,python-muranoclient==0.11.1,python-neutronclient==6.0.0,python-novaclient==6.0.0,python-openstackclient==3.3.0,python-subunit==1.2.0,python-swiftclient==3.1.0,pytz==2016.7,PyYAML==3.12,reno==1. 8.0,repoze.lru==0.6,requests==2.11.1,requests-mock==1.1.0,requestsexceptions==1.1.3,retrying==1.3.3,rfc3986==0.4.1,Routes==2.3.1,simplejson==3.10.0,six==1.10.0,snowballstemmer==1.2.1,Sphinx==1.3.6,sphinx-rtd-theme==0.1.9,SQLAlchemy==1.1.3,sqlalchemy-migrate==0.10.0,sqlparse==0.2.2,stevedore==1.18.0,suds-jurko==0.6,Tempita==0.5.2,tenacity==3.3.0,testrepository==0.0.20,testscenarios==0.5.0,testtools==2.2.0,traceback2==1.4.0,unicodecsv==0.14.1,unittest2==1.1.0,urllib3==1.19,warlock==1.2.0,WebOb==1.6.2,wrapt==1.10.8,yaql==1.1.1 py27 runtests: PYTHONHASHSEED='4235171505' py27 runtests: commands[0] | find . -type f -name *.py[c|o] -delete py27 runtests: commands[1] | python setup.py testr --slowest --testr-args= running testr running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ ${PYTHON:-python} -m subunit.run discover -t ./ ./congress/tests --list --- import errors --- Failed to import test module: congress.tests.datasources.test_magnum_driver Traceback (most recent call last): File "/opt/stack/congress/.tox/py27/local/lib/python2.7/site-packages/unittest2/loader.py", line 456, in _find_test_path module = self._get_module_from_name(name) File "/opt/stack/congress/.tox/py27/local/lib/python2.7/site-packages/unittest2/loader.py", line 395, in _get_module_from_name __import__(name) File "congress/tests/datasources/test_magnum_driver.py", line 18, in from congress.datasources import magnum_driver File "congress/datasources/magnum_driver.py", line 16, in from magnumclient import client as magnum_client ImportError: No module named magnumclient Non-zero exit code (2) from test listing. error: testr failed (3) ERROR: InvocationError: '/opt/stack/congress/.tox/py27/bin/python setup.py testr --slowest --testr-args=' __ summary __ ERROR: py27: commands failed" Pep8 is ok. What should I do to solve the error above? Anyway I've errors with the translators.. I've add the code to review. Ruben __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Congress] Magnum_driver
Ruben, I found the following two reviews: https://review.openstack.org/397150 Magnum_driver for congress https://review.openstack.org/397151 Test for magnum_driver Are these what you are referring to, or is it something else? Thanks, Adrian > On Nov 14, 2016, at 4:13 AM, Ruben wrote: > > Hi everybody, > I've added the magnum_driver code, that I'm trying to write for congress, to > review. > I think that I've made some errors. > > I hope in your help. > Ruben > > __ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Congress] Magnum_driver
Hi Ruben, Did a little debugging for you... 1) Run your unit tests $ tox -epy34 congress.tests.datasources.test_magnum ... File "/Users/tim/opencode/congress/congress/tests/datasources/test_magnum_driver.py", line 3, in from congress.datasources import magnum_driver File "/Users/tim/opencode/congress/congress/datasources/magnum_driver.py", line 51 self.magnum = magnum_client.Client(session=session) ^ IndentationError: unexpected indent The IndenetationError says you haven't lined up the code correctly. Python is sensitive to whitespace. I fixed this. 2) Run unit tests again. $ tox -epy34 congress.tests.datasources.test_magnum .. File "/Users/tim/opencode/congress/congress/datasources/magnum_driver.py", line 1, in from magnumclient import client as magnum_client Here the problem is that the package magnumclient doesn't exist. You need to add the python-magnumclient to the file requirements.txt. I fixed this for you as well. 3) Run unit tests again $ tox -epy34 congress.tests.datasources.test_magnum Forgot to capture the output this time, but there was a test failure. I went ahead and uncommented the two translators that you wrote because they seemed to be doing the right thing; that required combining your two unit tests into 1. 4) Run unit tests again $ tox -epy34 congress.tests.datasources.test_magnum Traceback (most recent call last): File "/Users/tim/opencode/congress/congress/tests/datasources/test_magnum_driver.py", line 97, in test_cluster_template_update_from_datasource self.assertEqual(self.driver.state, expected) File "/Users/tim/opencode/congress/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py", line 411, in assertEqual self.assertThat(observed, matcher, message) File "/Users/tim/opencode/congress/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py", line 498, in assertThat raise mismatch_error testtools.matchers._impl.MismatchError: !=: reference = {'cluster': {('None', 'k8s-cluster', 'None', 1, 1, 'CREATE_FAILED')}, 'cluster_template': {('None', 'k8s-cluster-template', 'None', 'None')}} reference = {'cluster': {('f88cb9c7-1e5d-42cb-b0dc-d9c3d0872ddf', 'k8s-cluster', 'testkey', 1, 1, 'CREATE_FAILED')}, 'cluster_template': {('3ddeaf4f-af3d-4534-9558-59bf28b1578b', 'k8s-cluster-template', 'kubernetes', 'flannel')}} actual= {'cluster': {('None', 'k8s-cluster', 'None', 1, 1, 'CREATE_FAILED')}, 'cluster_template': {('None', 'k8s-cluster-template', 'None', 'None')}} What's happening here is that the output of the translator does not match what the test says the output should be. The problem is that there's a mismatch between the keys in the data that you've mocked out (e.g. mock_cluster_template) and the fieldnames in the translator (e.g. cluster_template_translator). In the translator below you say the field names are 'id', 'name', 'COE', and 'Network_driver'. In the data you mocked out, the closest field names I can see are 'uuid', 'name', 'coe', and 'network_driver'. So fieldname 'name' matches the mocked out data, but the other field names do not. (Field names are case sensitive.) So if you change it so the fieldnames and the mock-data match, your unit test should pass. cluster_template_translator = { 'translation-type': 'HDICT', 'table-name': CLUSTER_TEMPLATE, 'selector-type': 'DICT_SELECTOR', 'field-translators': ({'fieldname': 'id', 'translator': value_trans}, {'fieldname': 'name', 'translator': value_trans}, {'fieldname': 'COE', 'translator': value_trans}, {'fieldname': 'Network_driver', 'translator': value_trans})} 5) Of course, just because the unit tests pass doesn't mean the driver is correct. The translator fieldnames need to match the actual data that magnum returns when you ask for the clusters and cluster_templates. One option is to read through the python-magnumclient code to see what fields it returns; the other is to run the commands yourself from the commandline to see what they return; another is to look at the Congress logs when the magnum driver is running (with debug=True in /etc/congress/congress.conf). 6) I pushed all my changes as a revision on top of one of your commits. We always include the code and the unit tests as one commit. So now there's 1 commit that you can download to your local machine and continue editing. Or you can just look at the code in gerrit and make changes to your code manually. https://review.openstack.org/#/c/397150/ To download, the safest thing is to create a new branch and apply the changes on top of that branch.You can also skip the 'git checkout' step if you want to apply the changes on top of the ones you already have, resolve conflicts, and then squash all the commits together. $ cd /path/to/congress $ git checkout origin/master
Re: [openstack-dev] [Congress] Magnum_driver
Hi Ruben, The fieldnames you care about are the fields as they show up in the JSON that gets returned from the magnum-client methods inside the datasource driver, e.g. from these methods... self.magnum.cluster_template.list() self.magnum.cluster.list() Several ways to check that you have the right fields.. 1) Suppose your Murano driver is running inside of Congress, and you've created an instance of it. $ openstack congress datasource create magnum magnum ... $ openstack congress datasource list You know you have the right fields in the driver if you're getting data in the Murano datasource instance. $ openstack congress datasource row list magnum cluster $ openstack congress datasource row list magnum cluster_template 2) If that doesn't work, check what JSON data magnum is returning on the CLI by adding the --debug parameter to the magnum CLI commands. [I haven't used magnum's client, but it looks to be using the standard openstack client, so should support --debug.] $ magnum cluster-template-list --debug You'll need to wade through the output to find the JSON that gets returned from the server. 3) If you think you have the right field names in the congress translators, but you're still not seeing data in the Murano datasource instance, you'll probably want to look at the congress logs. It looks like you have the right log.DEBUG statements in there. One trick is to disable all the datasources in congress other than your own to minimize the logs you need to look through. Another is to change your log.DEBUG to log.WARNING temporarily so your messages show up more clearly in the log. You can look at logs from the command line with: $ less -R /opt/stack/logs/congress.log Or go into 'screen -x', go to the Congress window, and look at the output in real time. You'll want a tutorial on screen if you haven't used it. Tim On Wed, Nov 16, 2016 at 9:37 AM Ruben wrote: > Hi everybody, > first of all: Tim thanks for your help. > > I've read the code in > python-magnumclient/magnumclient/v1/cluster_templates_shell.py and in > python-magnumclient/magnumclient/v1/clusters_shell.py, so I've modify the > translators in the magnum_driver according to > _show_cluster_template(cluster_template) and _show_cluster(cluster) methods > shown in these files. > Are these the methods to be taken into account for the translation? > Anyway I don't know if I made mistakes in the translation.. > > I've some doubts because if I made the CLI command 'magnum > cluster-template-list' I have: > > +--+--+ > | uuid | name | > +--+--+ > | 8d25a1ed-faa6-4305-a6a1-6559708c805b | k8s-cluster-template | > +--+--+ > > and if I made the CLI command 'magnum cluster-template-show > k8s-cluster-template' I have: > > +---+--+ > | Property | Value| > +---+--+ > | insecure_registry | -| > | labels| {} | > | updated_at| -| > | floating_ip_enabled | True | > | fixed_subnet | -| > | master_flavor_id | my | > | uuid | 8d25a1ed-faa6-4305-a6a1-6559708c805b | > | no_proxy | -| > | https_proxy | -| > | tls_disabled | False| > | keypair_id| testkey | > | public| False| > | http_proxy| -| > | docker_volume_size| 7| > | server_type | vm | > | external_network_id | public | > | cluster_distro| fedora-atomic| > | image_id | fedora-atomic-latest | > | volume_driver | -| > | registry_enabled | False| > | docker_storage_driver | devicemapper | > | apiserver_port| -| > | name | k8s-cluster-template | > | created_at| 2016-11-11T11:38:25+00:00| > | network_driver| flannel | > | fixed_network | -| > | coe | kubernetes | > | flavor_id | m1.tiny
Re: [openstack-dev] [Congress] Magnum_driver
Ruben, All the software that gets imported by your code needs to be listed in requirements.txt so that when tox runs, it installs that software. When I did some debugging for you I made the necessary change, so if you add that back into your change, that error should disappear. https://review.openstack.org/#/c/397150/ Tim On Wed, Nov 23, 2016 at 12:29 PM Ruben wrote: > Hi everybody, > I've trying to run the unit test of the magnum_driver. > > I make: > -cd /opt/stack/congress/ > -tox -epy27 > > but I have error with the import. > This is the output: > > "py27 develop-inst-noop: /opt/stack/congress > py27 installed: > alabaster==0.7.9,alembic==0.8.8,amqp==1.4.9,anyjson==0.3.3,appdirs==1.4.0,Babel==2.3.4,cachetools==2.0.0,cffi==1.9.1,cliff==2.2.0,cmd2==0.6.9,-e > git+ > http://git.openstack.org/openstack/congress@b2d96b56f721c941e85db565d203df008c455b19#egg=congress,contextlib2==0.5.4,coverage==4.2,cryptography==1.5.3,debtcollector==1.9.0,decorator==4.0.10,docutils==0.12,dogpile.cache==0.6.2,enum34==1.1.6,eventlet==0.19.0,extras==1.0.0,fasteners==0.14.1,fixtures==3.0.0,flake8==2.2.4,funcsigs==1.0.2,functools32==3.2.3.post2,futures==3.0.5,futurist==0.19.0,greenlet==0.4.10,hacking==0.10.2,idna==2.1,ipaddress==1.0.17,iso8601==0.1.11,Jinja2==2.8,jsonpatch==1.14,jsonpointer==1.10,jsonschema==2.5.1,keystoneauth1==2.15.0,keystonemiddleware==4.10.0,kombu==3.0.37,linecache2==1.0.0,lxml==3.6.4,Mako==1.0.6,MarkupSafe==0.23,mccabe==0.2.1,mock==2.0.0,monotonic==1.2,mox3==0.18.0,msgpack-python==0.4.8,netaddr==0.7.18,netifaces==0.10.5,openstacksdk==0.9.9,os-client-config==1.22.0,osc-lib==1.2.0,oslo.concurrency==3.15.0,oslo.config==3.19.0,oslo.context==2.10.0,oslo.db==4.14.0,oslo.i18n==3.10.0,oslo.log==3.17.0,oslo.messaging==5.12.0,oslo.middleware==3.20.0,oslo.policy==1.16.0,oslo.serialization==2.14.0,oslo.service==1.17.0,oslo.utils==3.18.0,oslo.vmware==2.15.0,oslosphinx==4.8.0,oslotest==2.11.0,Paste==2.0.3,PasteDeploy==1.5.2,pbr==1.10.0,pep8==1.5.7,pika==0.10.0,pika-pool==0.1.3,ply==3.9,positional==1.1.1,prettytable==0.7.2,PuLP==1.6.1,pyasn1==0.1.9,pycadf==2.4.0,pycparser==2.17,pyflakes==0.8.1,Pygments==2.1.3,pyinotify==0.9.6,pyOpenSSL==16.2.0,pyparsing==1.5.7,python-ceilometerclient==2.7.0,python-cinderclient==1.9.0,python-dateutil==2.6.0,python-editor==1.0.1,python-glanceclient==2.5.0,python-heatclient==1.5.0,python-ironicclient==1.8.0,python-keystoneclient==3.6.0,python-mimeparse==1.6.0,python-muranoclient==0.11.1,python-neutronclient==6.0.0,python-novaclient==6.0.0,python-openstackclient==3.3.0,python-subunit==1.2.0,python-swiftclient==3.1.0,pytz==2016.7,PyYAML==3.12,reno==1.8.0,repoze.lru==0.6,requests==2.11.1,requests-mock==1.1.0,requestsexceptions==1.1.3,retrying==1.3.3,rfc3986==0.4.1,Routes==2.3.1,simplejson==3.10.0,six==1.10.0,snowballstemmer==1.2.1,Sphinx==1.3.6,sphinx-rtd-theme==0.1.9,SQLAlchemy==1.1.3,sqlalchemy-migrate==0.10.0,sqlparse==0.2.2,stevedore==1.18.0,suds-jurko==0.6,Tempita==0.5.2,tenacity==3.3.0,testrepository==0.0.20,testscenarios==0.5.0,testtools==2.2.0,traceback2==1.4.0,unicodecsv==0.14.1,unittest2==1.1.0,urllib3==1.19,warlock==1.2.0,WebOb==1.6.2,wrapt==1.10.8,yaql==1.1.1 > py27 >
Re: [openstack-dev] [Congress] Magnum_driver
Hi Tim, I already have 'pyhton-magnumclient' in the requirements.txt file, but I still have the error. This is the /opt/stack/congress/requirements.txt file: "# The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. Babel>=2.3.4 # BSD eventlet!=0.18.3,>=0.18.2 # MIT PuLP>=1.4.1 # MIT keystoneauth1>=2.14.0 # Apache-2.0 keystonemiddleware!=4.5.0,>=4.2.0 # Apache-2.0 Paste # MIT PasteDeploy>=1.5.0 # MIT pbr>=1.6 # Apache-2.0 python-keystoneclient>=3.6.0 # Apache-2.0 python-heatclient>=1.5.0 # Apache-2.0 python-magnumclient python-muranoclient>=0.8.2 # Apache-2.0 python-novaclient!=2.33.0,>=2.29.0 # Apache-2.0 python-neutronclient>=5.1.0 # Apache-2.0 python-ceilometerclient>=2.5.0 # Apache-2.0 python-cinderclient!=1.7.0,!=1.7.1,>=1.6.0 # Apache-2.0 python-swiftclient>=2.2.0 # Apache-2.0 python-ironicclient>=1.6.0 # Apache-2.0 alembic>=0.8.4 # MIT python-dateutil>=2.4.2 # BSD python-glanceclient>=2.5.0 # Apache-2.0 Routes!=2.0,!=2.1,!=2.3.0,>=1.12.3;python_version=='2.7' # MIT Routes!=2.0,!=2.3.0,>=1.12.3;python_version!='2.7' # MIT six>=1.9.0 # MIT oslo.concurrency>=3.8.0 # Apache-2.0 oslo.config!=3.18.0,>=3.14.0 # Apache-2.0 oslo.context>=2.9.0 # Apache-2.0 oslo.db!=4.13.1,!=4.13.2,>=4.11.0 # Apache-2.0 oslo.messaging>=5.2.0 # Apache-2.0 oslo.policy>=1.15.0 # Apache-2.0 oslo.serialization>=1.10.0 # Apache-2.0 oslo.service>=1.10.0 # Apache-2.0 oslo.utils>=3.18.0 # Apache-2.0 oslo.middleware>=3.0.0 # Apache-2.0 oslo.vmware>=2.11.0 # Apache-2.0 oslo.log>=3.11.0 # Apache-2.0 WebOb>=1.6.0 # MIT" - Original Message - From: "Tim Hinrichs" To: "Ruben" , openstack-dev@lists.openstack.org Cc: "timothy l hinrichs" Sent: Wednesday, November 23, 2016 11:44:40 PM Subject: Re: [Congress] Magnum_driver Ruben, All the software that gets imported by your code needs to be listed in requirements.txt so that when tox runs, it installs that software. When I did some debugging for you I made the necessary change, so if you add that back into your change, that error should disappear. https://review.openstack.org/#/c/397150/ Tim On Wed, Nov 23, 2016 at 12:29 PM Ruben wrote: > Hi everybody, > I've trying to run the unit test of the magnum_driver. > > I make: > -cd /opt/stack/congress/ > -tox -epy27 > > but I have error with the import. > This is the output: > > "py27 develop-inst-noop: /opt/stack/congress > py27 installed: > alabaster==0.7.9,alembic==0.8.8,amqp==1.4.9,anyjson==0.3.3,appdirs==1.4.0,Babel==2.3.4,cachetools==2.0.0,cffi==1.9.1,cliff==2.2.0,cmd2==0.6.9,-e > git+ > http://git.openstack.org/openstack/congress@b2d96b56f721c941e85db565d203df008c455b19#egg=congress,contextlib2==0.5.4,coverage==4.2,cryptography==1.5.3,debtcollector==1.9.0,decorator==4.0.10,docutils==0.12,dogpile.cache==0.6.2,enum34==1.1.6,eventlet==0.19.0,extras==1.0.0,fasteners==0.14.1,fixtures==3.0.0,flake8==2.2.4,funcsigs==1.0.2,functools32==3.2.3.post2,futures==3.0.5,futurist==0.19.0,greenlet==0.4.10,hacking==0.10.2,idna==2.1,ipaddress==1.0.17,iso8601==0.1.11,Jinja2==2.8,jsonpatch==1.14,jsonpointer==1.10,jsonschema==2.5.1,keystoneauth1==2.15.0,keystonemiddleware==4.10.0,kombu==3.0.37,linecache2==1.0.0,lxml==3.6.4,Mako==1.0.6,MarkupSafe==0.23,mccabe==0.2.1,mock==2.0.0,monotonic==1.2,mox3==0.18.0,msgpack-python==0.4.8,netaddr==0.7.18,netifaces==0.10.5,openstacksdk==0.9.9,os-client-config==1.22.0,osc-lib==1.2.0,oslo.concurrency==3.15.0,oslo.config==3.19.0,oslo.context==2.10.0,oslo.db==4.14.0,oslo.i18n==3.10.0,oslo.log==3.17.0,oslo.messaging==5.12.0,oslo.middleware==3.20.0,oslo.po licy==1.16.0,oslo.serialization==2.14.0,oslo.service==1.17.0,oslo.utils==3.18.0,oslo.vmware==2.15.0,oslosphinx==4.8.0,oslotest==2.11.0,Paste==2.0.3,PasteDeploy==1.5.2,pbr==1.10.0,pep8==1.5.7,pika==0.10.0,pika-pool==0.1.3,ply==3.9,positional==1.1.1,prettytable==0.7.2,PuLP==1.6.1,pyasn1==0.1.9,pycadf==2.4.0,pycparser==2.17,pyflakes==0.8.1,Pygments==2.1.3,pyinotify==0.9.6,pyOpenSSL==16.2.0,pyparsing==1.5.7,python-ceilometerclient==2.7.0,python-cinderclient==1.9.0,python-dateutil==2.6.0,python-editor==1.0.1,python-glanceclient==2.5.0,python-heatclient==1.5.0,python-ironicclient==1.8.0,python-keystoneclient==3.6.0,python-mimeparse==1.6.0,python-muranoclient==0.11.1,python-neutronclient==6.0.0,python-novaclient==6.0.0,python-openstackclient==3.3.0,python-subunit==1.2.0,python-swiftclient==3.1.0,pytz==2016.7,PyYAML==3.12,reno==1.8.0,repoze.lru==0.6,requests==2.11.1,requests-mock==1.1.0,requestsexceptions==1.1.3,retrying==1.3.3,rfc3986==0.4.1,Routes==2.3.1,simplejson==3.10.0,six==1.10.0,sno wballstemmer==1.2.1,Sphinx==1.3.6,sphinx-rtd-theme==0.1.9,SQLAlchemy==1.1.3,sqlalchemy-migrate==0.10.0,sqlparse==0.2.2,stevedore==1.18.0,suds-jurko==0.6,Tempita==0.5.2,tenacity==3.3.0,testrepository==0.0.20,testscenarios==0.5.0,testtools==2.2.0,traceback2==1.4.0,unicodecsv==0.14.1,unittest2==1.1.0,urllib3==1.19,warlock==1.2.0,We
Re: [openstack-dev] [Congress] Magnum_driver
It's hard to debug that remotely. If you add the requirements.txt file with the magnum-client to the code you submitted to gerrit, the tests will run on gerrit, and I can see the errors for myself. The error message is pretty clearly saying that the module can't be found. Not sure what to recommend here--maybe diff your changes with the one I pushed to gerrit for you to see what's different? I think that putting the python-magnumclient into the /opt/stack/congress/requirements.tx file should work. Then again, I don't see python-magnumclient in that long list of installed packages. Tim On Wed, Nov 23, 2016 at 12:29 PM Ruben wrote: > Hi everybody, > I've trying to run the unit test of the magnum_driver. > > I make: > -cd /opt/stack/congress/ > -tox -epy27 > > but I have error with the import. > This is the output: > > "py27 develop-inst-noop: /opt/stack/congress > py27 installed: > alabaster==0.7.9,alembic==0.8.8,amqp==1.4.9,anyjson==0.3.3,appdirs==1.4.0,Babel==2.3.4,cachetools==2.0.0,cffi==1.9.1,cliff==2.2.0,cmd2==0.6.9,-e > git+ > http://git.openstack.org/openstack/congress@b2d96b56f721c941e85db565d203df008c455b19#egg=congress,contextlib2==0.5.4,coverage==4.2,cryptography==1.5.3,debtcollector==1.9.0,decorator==4.0.10,docutils==0.12,dogpile.cache==0.6.2,enum34==1.1.6,eventlet==0.19.0,extras==1.0.0,fasteners==0.14.1,fixtures==3.0.0,flake8==2.2.4,funcsigs==1.0.2,functools32==3.2.3.post2,futures==3.0.5,futurist==0.19.0,greenlet==0.4.10,hacking==0.10.2,idna==2.1,ipaddress==1.0.17,iso8601==0.1.11,Jinja2==2.8,jsonpatch==1.14,jsonpointer==1.10,jsonschema==2.5.1,keystoneauth1==2.15.0,keystonemiddleware==4.10.0,kombu==3.0.37,linecache2==1.0.0,lxml==3.6.4,Mako==1.0.6,MarkupSafe==0.23,mccabe==0.2.1,mock==2.0.0,monotonic==1.2,mox3==0.18.0,msgpack-python==0.4.8,netaddr==0.7.18,netifaces==0.10.5,openstacksdk==0.9.9,os-client-config==1.22.0,osc-lib==1.2.0,oslo.concurrency==3.15.0,oslo.config==3.19.0,oslo.context==2.10.0,oslo.db==4.14.0,oslo.i18n==3.10.0,oslo.log==3.17.0,oslo.messaging==5.12.0,oslo.middleware==3.20.0,oslo.policy==1.16.0,oslo.serialization==2.14.0,oslo.service==1.17.0,oslo.utils==3.18.0,oslo.vmware==2.15.0,oslosphinx==4.8.0,oslotest==2.11.0,Paste==2.0.3,PasteDeploy==1.5.2,pbr==1.10.0,pep8==1.5.7,pika==0.10.0,pika-pool==0.1.3,ply==3.9,positional==1.1.1,prettytable==0.7.2,PuLP==1.6.1,pyasn1==0.1.9,pycadf==2.4.0,pycparser==2.17,pyflakes==0.8.1,Pygments==2.1.3,pyinotify==0.9.6,pyOpenSSL==16.2.0,pyparsing==1.5.7,python-ceilometerclient==2.7.0,python-cinderclient==1.9.0,python-dateutil==2.6.0,python-editor==1.0.1,python-glanceclient==2.5.0,python-heatclient==1.5.0,python-ironicclient==1.8.0,python-keystoneclient==3.6.0,python-mimeparse==1.6.0,python-muranoclient==0.11.1,python-neutronclient==6.0.0,python-novaclient==6.0.0,python-openstackclient==3.3.0,python-subunit==1.2.0,python-swiftclient==3.1.0,pytz==2016.7,PyYAML==3.12,reno==1.8.0,repoze.lru==0.6,requests==2.11.1,requests-mock==1.1.0,requestsexceptions==1.1.3,retrying==1.3.3,rfc3986==0.4.1,Routes==2.3.1,simplejson==3.10.0,six==1.10.0,snowballstemmer==1.2.1,Sphinx==1.3.6,sphinx-rtd-theme==0.1.9,SQLAlchemy==1.1.3,sqlalchemy-migrate==0.10.0,sqlparse==0.2.2,stevedore==1.18.0,suds-jurko==0.6,Tempita==0.5.2,tenacity==3.3.0,testrepository==0.0.20,testscenarios==0.5.0,testtools==2.2.0,traceback2==1.4.0,unicodecsv==0.14.1,unittest2==1.1.0,urllib3==1.19,warlock==1.2.0,WebOb==1.6.2,wrapt==1.10.8,yaql==1.1.1 > py27 >
Re: [openstack-dev] [Congress] Magnum_driver
Hi Tim, I solved the problem with: tox --recreate -e py27 Now I no have the error on the import. The unit test still has some errors, but I don't know why.. Anyway, I've this error when I try to add the magnum_driver: 2016-11-24 20:56:27.191 INFO congress.datasources.datasource_driver [-] magnum:: polling 2016-11-24 20:56:27.192 DEBUG congress.datasources.datasource_driver [-] update table clusters. from (pid=18720) update_from_datasource /opt/stack/congress/congress/datasources/datasource_driver.py:1370 2016-11-24 20:56:27.427 DEBUG congress.datasources.magnum_driver [-] CLUSTERS: {'clusters': [http://10.0.2.15:9511/v1/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', u'rel': u'self'}, {u'href': u'http://10.0.2.15:9511/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', u'rel': u'bookmark'}], u'stack_id': u'17f1248d-286a-4fd4-9639-af5773670f03', u'master_count': 1, u'keypair': u'testkey', u'node_count': 1, u'create_timeout': 60, u'name': u'k8s-cluster'}>]} from (pid=18720) _translate_clusters /opt/stack/congress/congress/datasources/magnum_driver.py:165 2016-11-24 20:56:27.435 ERROR congress.datasources.datasource_driver [-] Datasource driver raised exception 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver Traceback (most recent call last): 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver File "/opt/stack/congress/congress/datasources/datasource_driver.py", line 1384, in poll 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver self.update_from_datasource() # sets self.state 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver File "/opt/stack/congress/congress/datasources/datasource_driver.py", line 1371, in update_from_datasource 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver self.update_methods[registered_table]() 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver File "/opt/stack/congress/congress/datasources/magnum_driver.py", line 150, in 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver {'clusters': self.magnum.clusters.list()}) 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver File "/opt/stack/congress/congress/datasources/datasource_utils.py", line 57, in inner 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver result = f(self, raw_data, *args, **kw) 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver File "/opt/stack/congress/congress/datasources/magnum_driver.py", line 167, in _translate_clusters 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver obj['clusters'], MagnumDriver.clusters_translator) 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver File "/opt/stack/congress/congress/datasources/datasource_driver.py", line 1048, in convert_objs 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver rows, _ = DataSourceDriver.convert_obj(o, translator) 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver File "/opt/stack/congress/congress/datasources/datasource_driver.py", line 1021, in convert_obj 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver parent_row_dict) 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver File "/opt/stack/congress/congress/datasources/datasource_driver.py", line 994, in _populate_translator_data_hdict 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver return cls._populate_hdict(translator, obj, parent_row_dict) 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver File "/opt/stack/congress/congress/datasources/datasource_driver.py", line 924, in _populate_hdict 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver cls._get_value(obj, field, selector), extract_fn) 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver File "/opt/stack/congress/congress/datasources/datasource_driver.py", line 693, in _get_value 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver if field in o: 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver TypeError: argument of type 'Cluster' is not iterable 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver 2016-11-24 20:56:27.435 INFO congress.datasources.datasource_driver [-] magnum:: finished polling Any suggestions to solve it? I've add the code to review. Ruben - Original Message - From: "Ruben" To: "Tim Hinrichs" Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" Sent: Thursday, November 24, 2016 12:44:38 AM Subject: Re: [Congress] Magnum_driver Hi Tim, I already have 'pyhton-magnumclient' in the requirements.txt file, but I still have the error. This is the /opt/stack/congress/requirements.txt file: "# The order of packages is significant, because pip processes them in the order # of appearance. Changing the order
Re: [openstack-dev] [Congress] Magnum_driver
Hi Ruben, Glad you got that worked out. Once in a while I end up deleting my .tox dir because it gets out of date. I guess that's what the --recreate option to tox does. So I learned something. :) The new error message looks to be saying that an object of type 'Cluster' cannot be iterated. Congress's _translate_clusters method assumes that what you give it is basically JSON (arrays, dictionaries, numbers, strings, bools). In this case Congress is trying to iterate over the keys of a dictionary but is getting a 'Cluster' Python object instead. What's happening is that when you do the cluster.list() (or whatever it's called) on the magnum-python you're getting back a list of Cluster Python objects instead of a list of dictionaries. To fix the problem, you'll want to take the results of cluster.list() and translate it into a list of dictionaries, and then hand that off to _translate_clusters. Probably you'll need to do the same for the cluster_template. So instead of ... clusters_method = lambda: self._translate_clusters( {'clusters': self.magnum.clusters.list()}) You'll want to do something like ... clusters_method = lambda: self._translate_clusters( {'clusters': [x.__dict__ for x in self.magnum.clusters.list()] }) Or at least, that's what I'd start trying. __dict__ grabs all the fields of an object and returns a dictionary. (If some of the values of that dictionary are also Python objects, then you might need something that's more complicated to recursively walk the result of clusters.list() and translate everything into lists and dictionaries. And I'm not sure that __dict__ will give you exactly what you want, but it's worth a try.). Tim On Thu, Nov 24, 2016 at 12:11 PM Ruben wrote: > Hi Tim, > I solved the problem with: > > tox --recreate -e py27 > > Now I no have the error on the import. The unit test still has some > errors, but I don't know why.. > > Anyway, I've this error when I try to add the magnum_driver: > > 2016-11-24 20:56:27.191 INFO congress.datasources.datasource_driver [-] > magnum:: polling > 2016-11-24 20:56:27.192 DEBUG congress.datasources.datasource_driver [-] > update table clusters. from (pid=18720) update_from_datasource > /opt/stack/congress/congress/datasources/datasource_driver.py:1370 > 2016-11-24 20:56:27.427 DEBUG congress.datasources.magnum_driver [-] > CLUSTERS: {'clusters': [ u'cluster_template_id': u'8d25a1ed-faa6-4305-a6a1-6559708c805b', u'uuid': > u'1634beb9-25de-4cdd-bafa-67537069f0cc', u'links': [{u'href': u' > http://10.0.2.15:9511/v1/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', > u'rel': u'self'}, {u'href': u' > http://10.0.2.15:9511/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', > u'rel': u'bookmark'}], u'stack_id': > u'17f1248d-286a-4fd4-9639-af5773670f03', u'master_count': 1, u'keypair': > u'testkey', u'node_count': 1, u'create_timeout': 60, u'name': > u'k8s-cluster'}>]} from (pid=18720) _translate_clusters > /opt/stack/congress/congress/datasources/magnum_driver.py:165 > 2016-11-24 20:56:27.435 ERROR congress.datasources.datasource_driver [-] > Datasource driver raised exception > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > Traceback (most recent call last): > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > File "/opt/stack/congress/congress/datasources/datasource_driver.py", line > 1384, in poll > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > self.update_from_datasource() # sets self.state > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > File "/opt/stack/congress/congress/datasources/datasource_driver.py", line > 1371, in update_from_datasource > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > self.update_methods[registered_table]() > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > File "/opt/stack/congress/congress/datasources/magnum_driver.py", line > 150, in > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > {'clusters': self.magnum.clusters.list()}) > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > File "/opt/stack/congress/congress/datasources/datasource_utils.py", line > 57, in inner > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > result = f(self, raw_data, *args, **kw) > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > File "/opt/stack/congress/congress/datasources/magnum_driver.py", line > 167, in _translate_clusters > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > obj['clusters'], MagnumDriver.clusters_translator) > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > File "/opt/stack/congress/congress/datasources/datasource_driver.py", line > 1048, in convert_objs > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > rows, _ = DataSourceDriver.convert_obj(o, translator) > 2016-
Re: [openstack-dev] [Congress] Magnum_driver
Hi Tim, You are great. It works! Thanks a lot! I've also solved the problem with py27. The unit test seems to work. The only thing that seems not to work is populate the 'clusters_links' and 'cluster_templates_links' tables: they are empty. Also, the 'labels' table is empty. I've no errors anyway. Are these problems according to you? Should I to try to add the translation of pods, containers and services? I've add the code to review. Ruben - Original Message - From: "Tim Hinrichs" To: "Ruben" Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" Sent: Friday, November 25, 2016 10:36:29 PM Subject: Re: [Congress] Magnum_driver Hi Ruben, Glad you got that worked out. Once in a while I end up deleting my .tox dir because it gets out of date. I guess that's what the --recreate option to tox does. So I learned something. :) The new error message looks to be saying that an object of type 'Cluster' cannot be iterated. Congress's _translate_clusters method assumes that what you give it is basically JSON (arrays, dictionaries, numbers, strings, bools). In this case Congress is trying to iterate over the keys of a dictionary but is getting a 'Cluster' Python object instead. What's happening is that when you do the cluster.list() (or whatever it's called) on the magnum-python you're getting back a list of Cluster Python objects instead of a list of dictionaries. To fix the problem, you'll want to take the results of cluster.list() and translate it into a list of dictionaries, and then hand that off to _translate_clusters. Probably you'll need to do the same for the cluster_template. So instead of ... clusters_method = lambda: self._translate_clusters( {'clusters': self.magnum.clusters.list()}) You'll want to do something like ... clusters_method = lambda: self._translate_clusters( {'clusters': [x.__dict__ for x in self.magnum.clusters.list()] }) Or at least, that's what I'd start trying. __dict__ grabs all the fields of an object and returns a dictionary. (If some of the values of that dictionary are also Python objects, then you might need something that's more complicated to recursively walk the result of clusters.list() and translate everything into lists and dictionaries. And I'm not sure that __dict__ will give you exactly what you want, but it's worth a try.). Tim On Thu, Nov 24, 2016 at 12:11 PM Ruben wrote: > Hi Tim, > I solved the problem with: > > tox --recreate -e py27 > > Now I no have the error on the import. The unit test still has some > errors, but I don't know why.. > > Anyway, I've this error when I try to add the magnum_driver: > > 2016-11-24 20:56:27.191 INFO congress.datasources.datasource_driver [-] > magnum:: polling > 2016-11-24 20:56:27.192 DEBUG congress.datasources.datasource_driver [-] > update table clusters. from (pid=18720) update_from_datasource > /opt/stack/congress/congress/datasources/datasource_driver.py:1370 > 2016-11-24 20:56:27.427 DEBUG congress.datasources.magnum_driver [-] > CLUSTERS: {'clusters': [ u'cluster_template_id': u'8d25a1ed-faa6-4305-a6a1-6559708c805b', u'uuid': > u'1634beb9-25de-4cdd-bafa-67537069f0cc', u'links': [{u'href': u' > http://10.0.2.15:9511/v1/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', > u'rel': u'self'}, {u'href': u' > http://10.0.2.15:9511/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', > u'rel': u'bookmark'}], u'stack_id': > u'17f1248d-286a-4fd4-9639-af5773670f03', u'master_count': 1, u'keypair': > u'testkey', u'node_count': 1, u'create_timeout': 60, u'name': > u'k8s-cluster'}>]} from (pid=18720) _translate_clusters > /opt/stack/congress/congress/datasources/magnum_driver.py:165 > 2016-11-24 20:56:27.435 ERROR congress.datasources.datasource_driver [-] > Datasource driver raised exception > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > Traceback (most recent call last): > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > File "/opt/stack/congress/congress/datasources/datasource_driver.py", line > 1384, in poll > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > self.update_from_datasource() # sets self.state > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > File "/opt/stack/congress/congress/datasources/datasource_driver.py", line > 1371, in update_from_datasource > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > self.update_methods[registered_table]() > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > File "/opt/stack/congress/congress/datasources/magnum_driver.py", line > 150, in > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > {'clusters': self.magnum.clusters.list()}) > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > File "/opt/stack/congress/congress/datasources/datasource_utils.py", line > 57, in inner > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_d
Re: [openstack-dev] [Congress] Magnum_driver
Definitely push that code up into Gerrit so we can all take a look. Data like pods and containers is probably the most valuable data from Magnum, so I'd definitely recommend adding that. But push the code you have to Gerrit first. (As long as you leave the ChangeId the same each time you push to Gerrit, Gerrit will keep all of the versions you pushed organized together, yet keep the versions separate.) Tim On Fri, Nov 25, 2016 at 3:06 PM Ruben wrote: > Hi Tim, > You are great. It works! Thanks a lot! > I've also solved the problem with py27. The unit test seems to work. > The only thing that seems not to work is populate the 'clusters_links' and > 'cluster_templates_links' tables: they are empty. > Also, the 'labels' table is empty. > I've no errors anyway. > Are these problems according to you? > > Should I to try to add the translation of pods, containers and services? > > I've add the code to review. > > Ruben > - Original Message - > From: "Tim Hinrichs" > To: "Ruben" > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > timothy.l.hinri...@gmail.com> > Sent: Friday, November 25, 2016 10:36:29 PM > Subject: Re: [Congress] Magnum_driver > > Hi Ruben, > > Glad you got that worked out. Once in a while I end up deleting my .tox > dir because it gets out of date. I guess that's what the --recreate option > to tox does. So I learned something. :) > > The new error message looks to be saying that an object of type 'Cluster' > cannot be iterated. Congress's _translate_clusters method assumes that > what you give it is basically JSON (arrays, dictionaries, numbers, strings, > bools). In this case Congress is trying to iterate over the keys of a > dictionary but is getting a 'Cluster' Python object instead. What's > happening is that when you do the cluster.list() (or whatever it's called) > on the magnum-python you're getting back a list of Cluster Python objects > instead of a list of dictionaries. > > To fix the problem, you'll want to take the results of cluster.list() and > translate it into a list of dictionaries, and then hand that off to > _translate_clusters. Probably you'll need to do the same for the > cluster_template. So instead of ... > > clusters_method = lambda: self._translate_clusters( > {'clusters': self.magnum.clusters.list()}) > > You'll want to do something like ... > > clusters_method = lambda: self._translate_clusters( > {'clusters': [x.__dict__ for x in self.magnum.clusters.list()] > }) > > Or at least, that's what I'd start trying. __dict__ grabs all the fields > of an object and returns a dictionary. (If some of the values of that > dictionary are also Python objects, then you might need something that's > more complicated to recursively walk the result of clusters.list() and > translate everything into lists and dictionaries. And I'm not sure that > __dict__ will give you exactly what you want, but it's worth a try.). > > Tim > > > On Thu, Nov 24, 2016 at 12:11 PM Ruben > wrote: > > > Hi Tim, > > I solved the problem with: > > > > tox --recreate -e py27 > > > > Now I no have the error on the import. The unit test still has some > > errors, but I don't know why.. > > > > Anyway, I've this error when I try to add the magnum_driver: > > > > 2016-11-24 20:56:27.191 INFO congress.datasources.datasource_driver [-] > > magnum:: polling > > 2016-11-24 20:56:27.192 DEBUG congress.datasources.datasource_driver [-] > > update table clusters. from (pid=18720) update_from_datasource > > /opt/stack/congress/congress/datasources/datasource_driver.py:1370 > > 2016-11-24 20:56:27.427 DEBUG congress.datasources.magnum_driver [-] > > CLUSTERS: {'clusters': [ > u'cluster_template_id': u'8d25a1ed-faa6-4305-a6a1-6559708c805b', u'uuid': > > u'1634beb9-25de-4cdd-bafa-67537069f0cc', u'links': [{u'href': u' > > http://10.0.2.15:9511/v1/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', > > u'rel': u'self'}, {u'href': u' > > http://10.0.2.15:9511/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', > > u'rel': u'bookmark'}], u'stack_id': > > u'17f1248d-286a-4fd4-9639-af5773670f03', u'master_count': 1, u'keypair': > > u'testkey', u'node_count': 1, u'create_timeout': 60, u'name': > > u'k8s-cluster'}>]} from (pid=18720) _translate_clusters > > /opt/stack/congress/congress/datasources/magnum_driver.py:165 > > 2016-11-24 20:56:27.435 ERROR congress.datasources.datasource_driver [-] > > Datasource driver raised exception > > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > > Traceback (most recent call last): > > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > > File "/opt/stack/congress/congress/datasources/datasource_driver.py", > line > > 1384, in poll > > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > > self.update_from_datasource() # sets self.state > > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > > File "/opt/stack/congress/congress/datasou
Re: [openstack-dev] [Congress] Magnum_driver
Hi Tim, I've added the code of magnum_driver and its unit test to review. It seems everything works. Ruben - Original Message - From: "Tim Hinrichs" To: "Ruben" Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" Sent: Saturday, November 26, 2016 12:48:12 AM Subject: Re: [Congress] Magnum_driver Definitely push that code up into Gerrit so we can all take a look. Data like pods and containers is probably the most valuable data from Magnum, so I'd definitely recommend adding that. But push the code you have to Gerrit first. (As long as you leave the ChangeId the same each time you push to Gerrit, Gerrit will keep all of the versions you pushed organized together, yet keep the versions separate.) Tim On Fri, Nov 25, 2016 at 3:06 PM Ruben wrote: > Hi Tim, > You are great. It works! Thanks a lot! > I've also solved the problem with py27. The unit test seems to work. > The only thing that seems not to work is populate the 'clusters_links' and > 'cluster_templates_links' tables: they are empty. > Also, the 'labels' table is empty. > I've no errors anyway. > Are these problems according to you? > > Should I to try to add the translation of pods, containers and services? > > I've add the code to review. > > Ruben > - Original Message - > From: "Tim Hinrichs" > To: "Ruben" > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > timothy.l.hinri...@gmail.com> > Sent: Friday, November 25, 2016 10:36:29 PM > Subject: Re: [Congress] Magnum_driver > > Hi Ruben, > > Glad you got that worked out. Once in a while I end up deleting my .tox > dir because it gets out of date. I guess that's what the --recreate option > to tox does. So I learned something. :) > > The new error message looks to be saying that an object of type 'Cluster' > cannot be iterated. Congress's _translate_clusters method assumes that > what you give it is basically JSON (arrays, dictionaries, numbers, strings, > bools). In this case Congress is trying to iterate over the keys of a > dictionary but is getting a 'Cluster' Python object instead. What's > happening is that when you do the cluster.list() (or whatever it's called) > on the magnum-python you're getting back a list of Cluster Python objects > instead of a list of dictionaries. > > To fix the problem, you'll want to take the results of cluster.list() and > translate it into a list of dictionaries, and then hand that off to > _translate_clusters. Probably you'll need to do the same for the > cluster_template. So instead of ... > > clusters_method = lambda: self._translate_clusters( > {'clusters': self.magnum.clusters.list()}) > > You'll want to do something like ... > > clusters_method = lambda: self._translate_clusters( > {'clusters': [x.__dict__ for x in self.magnum.clusters.list()] > }) > > Or at least, that's what I'd start trying. __dict__ grabs all the fields > of an object and returns a dictionary. (If some of the values of that > dictionary are also Python objects, then you might need something that's > more complicated to recursively walk the result of clusters.list() and > translate everything into lists and dictionaries. And I'm not sure that > __dict__ will give you exactly what you want, but it's worth a try.). > > Tim > > > On Thu, Nov 24, 2016 at 12:11 PM Ruben > wrote: > > > Hi Tim, > > I solved the problem with: > > > > tox --recreate -e py27 > > > > Now I no have the error on the import. The unit test still has some > > errors, but I don't know why.. > > > > Anyway, I've this error when I try to add the magnum_driver: > > > > 2016-11-24 20:56:27.191 INFO congress.datasources.datasource_driver [-] > > magnum:: polling > > 2016-11-24 20:56:27.192 DEBUG congress.datasources.datasource_driver [-] > > update table clusters. from (pid=18720) update_from_datasource > > /opt/stack/congress/congress/datasources/datasource_driver.py:1370 > > 2016-11-24 20:56:27.427 DEBUG congress.datasources.magnum_driver [-] > > CLUSTERS: {'clusters': [ > u'cluster_template_id': u'8d25a1ed-faa6-4305-a6a1-6559708c805b', u'uuid': > > u'1634beb9-25de-4cdd-bafa-67537069f0cc', u'links': [{u'href': u' > > http://10.0.2.15:9511/v1/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', > > u'rel': u'self'}, {u'href': u' > > http://10.0.2.15:9511/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', > > u'rel': u'bookmark'}], u'stack_id': > > u'17f1248d-286a-4fd4-9639-af5773670f03', u'master_count': 1, u'keypair': > > u'testkey', u'node_count': 1, u'create_timeout': 60, u'name': > > u'k8s-cluster'}>]} from (pid=18720) _translate_clusters > > /opt/stack/congress/congress/datasources/magnum_driver.py:165 > > 2016-11-24 20:56:27.435 ERROR congress.datasources.datasource_driver [-] > > Datasource driver raised exception > > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > > Traceback (most recent call last): > > 2016-11-24 20:56:27.435 TRACE congress.datasources.datasource_driver > > File "/opt/stack/congr
Re: [openstack-dev] [Congress] Magnum_driver
Hi Ruben, I left a comment on one of the changes; after you take care of that I'll take a closer look at the code. Let me know if you have questions. Tim On Tue, Nov 29, 2016 at 4:06 AM Ruben wrote: > Hi Tim, > I've added the code of magnum_driver and its unit test to review. > It seems everything works. > > Ruben > > - Original Message - > From: "Tim Hinrichs" > To: "Ruben" > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > timothy.l.hinri...@gmail.com> > Sent: Saturday, November 26, 2016 12:48:12 AM > Subject: Re: [Congress] Magnum_driver > > Definitely push that code up into Gerrit so we can all take a look. Data > like pods and containers is probably the most valuable data from Magnum, so > I'd definitely recommend adding that. But push the code you have to Gerrit > first. (As long as you leave the ChangeId the same each time you push to > Gerrit, Gerrit will keep all of the versions you pushed organized together, > yet keep the versions separate.) > > Tim > > On Fri, Nov 25, 2016 at 3:06 PM Ruben > wrote: > > > Hi Tim, > > You are great. It works! Thanks a lot! > > I've also solved the problem with py27. The unit test seems to work. > > The only thing that seems not to work is populate the 'clusters_links' > and > > 'cluster_templates_links' tables: they are empty. > > Also, the 'labels' table is empty. > > I've no errors anyway. > > Are these problems according to you? > > > > Should I to try to add the translation of pods, containers and services? > > > > I've add the code to review. > > > > Ruben > > - Original Message - > > From: "Tim Hinrichs" > > To: "Ruben" > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > timothy.l.hinri...@gmail.com> > > Sent: Friday, November 25, 2016 10:36:29 PM > > Subject: Re: [Congress] Magnum_driver > > > > Hi Ruben, > > > > Glad you got that worked out. Once in a while I end up deleting my .tox > > dir because it gets out of date. I guess that's what the --recreate > option > > to tox does. So I learned something. :) > > > > The new error message looks to be saying that an object of type 'Cluster' > > cannot be iterated. Congress's _translate_clusters method assumes that > > what you give it is basically JSON (arrays, dictionaries, numbers, > strings, > > bools). In this case Congress is trying to iterate over the keys of a > > dictionary but is getting a 'Cluster' Python object instead. What's > > happening is that when you do the cluster.list() (or whatever it's > called) > > on the magnum-python you're getting back a list of Cluster Python objects > > instead of a list of dictionaries. > > > > To fix the problem, you'll want to take the results of cluster.list() and > > translate it into a list of dictionaries, and then hand that off to > > _translate_clusters. Probably you'll need to do the same for the > > cluster_template. So instead of ... > > > > clusters_method = lambda: self._translate_clusters( > > {'clusters': self.magnum.clusters.list()}) > > > > You'll want to do something like ... > > > > clusters_method = lambda: self._translate_clusters( > > {'clusters': [x.__dict__ for x in > self.magnum.clusters.list()] > > }) > > > > Or at least, that's what I'd start trying. __dict__ grabs all the fields > > of an object and returns a dictionary. (If some of the values of that > > dictionary are also Python objects, then you might need something that's > > more complicated to recursively walk the result of clusters.list() and > > translate everything into lists and dictionaries. And I'm not sure that > > __dict__ will give you exactly what you want, but it's worth a try.). > > > > Tim > > > > > > On Thu, Nov 24, 2016 at 12:11 PM Ruben > > > wrote: > > > > > Hi Tim, > > > I solved the problem with: > > > > > > tox --recreate -e py27 > > > > > > Now I no have the error on the import. The unit test still has some > > > errors, but I don't know why.. > > > > > > Anyway, I've this error when I try to add the magnum_driver: > > > > > > 2016-11-24 20:56:27.191 INFO congress.datasources.datasource_driver [-] > > > magnum:: polling > > > 2016-11-24 20:56:27.192 DEBUG congress.datasources.datasource_driver > [-] > > > update table clusters. from (pid=18720) update_from_datasource > > > /opt/stack/congress/congress/datasources/datasource_driver.py:1370 > > > 2016-11-24 20:56:27.427 DEBUG congress.datasources.magnum_driver [-] > > > CLUSTERS: {'clusters': [ > > u'cluster_template_id': u'8d25a1ed-faa6-4305-a6a1-6559708c805b', > u'uuid': > > > u'1634beb9-25de-4cdd-bafa-67537069f0cc', u'links': [{u'href': u' > > > http://10.0.2.15:9511/v1/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc > ', > > > u'rel': u'self'}, {u'href': u' > > > http://10.0.2.15:9511/clusters/1634beb9-25de-4cdd-bafa-67537069f0cc', > > > u'rel': u'bookmark'}], u'stack_id': > > > u'17f1248d-286a-4fd4-9639-af5773670f03', u'master_count': 1, > u'keypair': > > > u'testkey', u'node_count': 1, u'crea
Re: [openstack-dev] [Congress] Magnum_driver
Hi Tim, what should I do to squash all the commits into a single one? To add the code to review I made: git add git commit git review Isn't it correct? Ruben - Messaggio originale - Da: "Tim Hinrichs" A: "Ruben" Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" Inviato: Mercoledì, 30 novembre 2016 2:34:22 Oggetto: Re: [Congress] Magnum_driver Hi Ruben, I left a comment on one of the changes; after you take care of that I'll take a closer look at the code. Let me know if you have questions. Tim On Tue, Nov 29, 2016 at 4:06 AM Ruben wrote: > Hi Tim, > I've added the code of magnum_driver and its unit test to review. > It seems everything works. > > Ruben > > - Original Message - > From: "Tim Hinrichs" > To: "Ruben" > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > timothy.l.hinri...@gmail.com> > Sent: Saturday, November 26, 2016 12:48:12 AM > Subject: Re: [Congress] Magnum_driver > > Definitely push that code up into Gerrit so we can all take a look. Data > like pods and containers is probably the most valuable data from Magnum, so > I'd definitely recommend adding that. But push the code you have to Gerrit > first. (As long as you leave the ChangeId the same each time you push to > Gerrit, Gerrit will keep all of the versions you pushed organized together, > yet keep the versions separate.) > > Tim > > On Fri, Nov 25, 2016 at 3:06 PM Ruben > wrote: > > > Hi Tim, > > You are great. It works! Thanks a lot! > > I've also solved the problem with py27. The unit test seems to work. > > The only thing that seems not to work is populate the 'clusters_links' > and > > 'cluster_templates_links' tables: they are empty. > > Also, the 'labels' table is empty. > > I've no errors anyway. > > Are these problems according to you? > > > > Should I to try to add the translation of pods, containers and services? > > > > I've add the code to review. > > > > Ruben > > - Original Message - > > From: "Tim Hinrichs" > > To: "Ruben" > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > timothy.l.hinri...@gmail.com> > > Sent: Friday, November 25, 2016 10:36:29 PM > > Subject: Re: [Congress] Magnum_driver > > > > Hi Ruben, > > > > Glad you got that worked out. Once in a while I end up deleting my .tox > > dir because it gets out of date. I guess that's what the --recreate > option > > to tox does. So I learned something. :) > > > > The new error message looks to be saying that an object of type 'Cluster' > > cannot be iterated. Congress's _translate_clusters method assumes that > > what you give it is basically JSON (arrays, dictionaries, numbers, > strings, > > bools). In this case Congress is trying to iterate over the keys of a > > dictionary but is getting a 'Cluster' Python object instead. What's > > happening is that when you do the cluster.list() (or whatever it's > called) > > on the magnum-python you're getting back a list of Cluster Python objects > > instead of a list of dictionaries. > > > > To fix the problem, you'll want to take the results of cluster.list() and > > translate it into a list of dictionaries, and then hand that off to > > _translate_clusters. Probably you'll need to do the same for the > > cluster_template. So instead of ... > > > > clusters_method = lambda: self._translate_clusters( > > {'clusters': self.magnum.clusters.list()}) > > > > You'll want to do something like ... > > > > clusters_method = lambda: self._translate_clusters( > > {'clusters': [x.__dict__ for x in > self.magnum.clusters.list()] > > }) > > > > Or at least, that's what I'd start trying. __dict__ grabs all the fields > > of an object and returns a dictionary. (If some of the values of that > > dictionary are also Python objects, then you might need something that's > > more complicated to recursively walk the result of clusters.list() and > > translate everything into lists and dictionaries. And I'm not sure that > > __dict__ will give you exactly what you want, but it's worth a try.). > > > > Tim > > > > > > On Thu, Nov 24, 2016 at 12:11 PM Ruben > > > wrote: > > > > > Hi Tim, > > > I solved the problem with: > > > > > > tox --recreate -e py27 > > > > > > Now I no have the error on the import. The unit test still has some > > > errors, but I don't know why.. > > > > > > Anyway, I've this error when I try to add the magnum_driver: > > > > > > 2016-11-24 20:56:27.191 INFO congress.datasources.datasource_driver [-] > > > magnum:: polling > > > 2016-11-24 20:56:27.192 DEBUG congress.datasources.datasource_driver > [-] > > > update table clusters. from (pid=18720) update_from_datasource > > > /opt/stack/congress/congress/datasources/datasource_driver.py:1370 > > > 2016-11-24 20:56:27.427 DEBUG congress.datasources.magnum_driver [-] > > > CLUSTERS: {'clusters': [ > > u'cluster_template_id': u'8d25a1ed-faa6-4305-a6a1-6559708c805b', > u'uuid': > > > u'1634beb9-25de-4cdd-bafa-67537069f0cc', u'links':
Re: [openstack-dev] [Congress] Magnum_driver
Hi Ruben, What you're doing is correct. The downside is that it creates a new commit for every change you make, and all of those commits show up on gerrit. In OpenStack (and other projects I've seen that use Gerrit for code reviews) you squash those commits into 1 change so that it's easier for reviewers to see the change as a whole. (Projects that use Github for code reviews do more like what you're doing now). To see your Here's a blog showing you what to do... https://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one/ You can probably do $ git rebase -i and then follow the instructions in the blog that say you replace the 'pick' for all the commits after the first with 'squash' (or 's' for short). So something like the following. pick f392171 Added new feature X squash ba9dd9a Added new elements to page design squash df71a27 Updated CSS for new elements After that, you should be able to do ... $ git review Tim On Wed, Nov 30, 2016 at 5:23 AM Ruben wrote: > Hi Tim, > what should I do to squash all the commits into a single one? > > To add the code to review I made: > > git add > git commit > git review > > Isn't it correct? > > Ruben > > - Messaggio originale - > Da: "Tim Hinrichs" > A: "Ruben" > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > timothy.l.hinri...@gmail.com> > Inviato: Mercoledì, 30 novembre 2016 2:34:22 > Oggetto: Re: [Congress] Magnum_driver > > Hi Ruben, > > I left a comment on one of the changes; after you take care of that I'll > take a closer look at the code. Let me know if you have questions. > > Tim > > On Tue, Nov 29, 2016 at 4:06 AM Ruben > wrote: > > > Hi Tim, > > I've added the code of magnum_driver and its unit test to review. > > It seems everything works. > > > > Ruben > > > > - Original Message - > > From: "Tim Hinrichs" > > To: "Ruben" > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > timothy.l.hinri...@gmail.com> > > Sent: Saturday, November 26, 2016 12:48:12 AM > > Subject: Re: [Congress] Magnum_driver > > > > Definitely push that code up into Gerrit so we can all take a look. Data > > like pods and containers is probably the most valuable data from Magnum, > so > > I'd definitely recommend adding that. But push the code you have to > Gerrit > > first. (As long as you leave the ChangeId the same each time you push to > > Gerrit, Gerrit will keep all of the versions you pushed organized > together, > > yet keep the versions separate.) > > > > Tim > > > > On Fri, Nov 25, 2016 at 3:06 PM Ruben > > wrote: > > > > > Hi Tim, > > > You are great. It works! Thanks a lot! > > > I've also solved the problem with py27. The unit test seems to work. > > > The only thing that seems not to work is populate the 'clusters_links' > > and > > > 'cluster_templates_links' tables: they are empty. > > > Also, the 'labels' table is empty. > > > I've no errors anyway. > > > Are these problems according to you? > > > > > > Should I to try to add the translation of pods, containers and > services? > > > > > > I've add the code to review. > > > > > > Ruben > > > - Original Message - > > > From: "Tim Hinrichs" > > > To: "Ruben" > > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > > timothy.l.hinri...@gmail.com> > > > Sent: Friday, November 25, 2016 10:36:29 PM > > > Subject: Re: [Congress] Magnum_driver > > > > > > Hi Ruben, > > > > > > Glad you got that worked out. Once in a while I end up deleting my > .tox > > > dir because it gets out of date. I guess that's what the --recreate > > option > > > to tox does. So I learned something. :) > > > > > > The new error message looks to be saying that an object of type > 'Cluster' > > > cannot be iterated. Congress's _translate_clusters method assumes that > > > what you give it is basically JSON (arrays, dictionaries, numbers, > > strings, > > > bools). In this case Congress is trying to iterate over the keys of a > > > dictionary but is getting a 'Cluster' Python object instead. What's > > > happening is that when you do the cluster.list() (or whatever it's > > called) > > > on the magnum-python you're getting back a list of Cluster Python > objects > > > instead of a list of dictionaries. > > > > > > To fix the problem, you'll want to take the results of cluster.list() > and > > > translate it into a list of dictionaries, and then hand that off to > > > _translate_clusters. Probably you'll need to do the same for the > > > cluster_template. So instead of ... > > > > > > clusters_method = lambda: self._translate_clusters( > > > {'clusters': self.magnum.clusters.list()}) > > > > > > You'll want to do something like ... > > > > > > clusters_method = lambda: self._translate_clusters( > > > {'clusters': [x.__dict__ for x in > > self.magnum.clusters.list()] > > > }) > > > > > > Or at least, that's what I'd start trying. __dict__ grabs all the > fields > > > of an object and returns a di
Re: [openstack-dev] [Congress] Magnum_driver
Hi Tim, sorry for the late, but I've had a busy week. Anyway, I've tried to add the magnum_driver to review into a single commit. I don't know if I have been able.. Ruben - Messaggio originale - Da: "Tim Hinrichs" A: "Ruben" Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" Inviato: Mercoledì, 30 novembre 2016 22:04:32 Oggetto: Re: [Congress] Magnum_driver Hi Ruben, What you're doing is correct. The downside is that it creates a new commit for every change you make, and all of those commits show up on gerrit. In OpenStack (and other projects I've seen that use Gerrit for code reviews) you squash those commits into 1 change so that it's easier for reviewers to see the change as a whole. (Projects that use Github for code reviews do more like what you're doing now). To see your Here's a blog showing you what to do... https://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one/ You can probably do $ git rebase -i and then follow the instructions in the blog that say you replace the 'pick' for all the commits after the first with 'squash' (or 's' for short). So something like the following. pick f392171 Added new feature X squash ba9dd9a Added new elements to page design squash df71a27 Updated CSS for new elements After that, you should be able to do ... $ git review Tim On Wed, Nov 30, 2016 at 5:23 AM Ruben wrote: > Hi Tim, > what should I do to squash all the commits into a single one? > > To add the code to review I made: > > git add > git commit > git review > > Isn't it correct? > > Ruben > > - Messaggio originale - > Da: "Tim Hinrichs" > A: "Ruben" > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > timothy.l.hinri...@gmail.com> > Inviato: Mercoledì, 30 novembre 2016 2:34:22 > Oggetto: Re: [Congress] Magnum_driver > > Hi Ruben, > > I left a comment on one of the changes; after you take care of that I'll > take a closer look at the code. Let me know if you have questions. > > Tim > > On Tue, Nov 29, 2016 at 4:06 AM Ruben > wrote: > > > Hi Tim, > > I've added the code of magnum_driver and its unit test to review. > > It seems everything works. > > > > Ruben > > > > - Original Message - > > From: "Tim Hinrichs" > > To: "Ruben" > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > timothy.l.hinri...@gmail.com> > > Sent: Saturday, November 26, 2016 12:48:12 AM > > Subject: Re: [Congress] Magnum_driver > > > > Definitely push that code up into Gerrit so we can all take a look. Data > > like pods and containers is probably the most valuable data from Magnum, > so > > I'd definitely recommend adding that. But push the code you have to > Gerrit > > first. (As long as you leave the ChangeId the same each time you push to > > Gerrit, Gerrit will keep all of the versions you pushed organized > together, > > yet keep the versions separate.) > > > > Tim > > > > On Fri, Nov 25, 2016 at 3:06 PM Ruben > > wrote: > > > > > Hi Tim, > > > You are great. It works! Thanks a lot! > > > I've also solved the problem with py27. The unit test seems to work. > > > The only thing that seems not to work is populate the 'clusters_links' > > and > > > 'cluster_templates_links' tables: they are empty. > > > Also, the 'labels' table is empty. > > > I've no errors anyway. > > > Are these problems according to you? > > > > > > Should I to try to add the translation of pods, containers and > services? > > > > > > I've add the code to review. > > > > > > Ruben > > > - Original Message - > > > From: "Tim Hinrichs" > > > To: "Ruben" > > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > > timothy.l.hinri...@gmail.com> > > > Sent: Friday, November 25, 2016 10:36:29 PM > > > Subject: Re: [Congress] Magnum_driver > > > > > > Hi Ruben, > > > > > > Glad you got that worked out. Once in a while I end up deleting my > .tox > > > dir because it gets out of date. I guess that's what the --recreate > > option > > > to tox does. So I learned something. :) > > > > > > The new error message looks to be saying that an object of type > 'Cluster' > > > cannot be iterated. Congress's _translate_clusters method assumes that > > > what you give it is basically JSON (arrays, dictionaries, numbers, > > strings, > > > bools). In this case Congress is trying to iterate over the keys of a > > > dictionary but is getting a 'Cluster' Python object instead. What's > > > happening is that when you do the cluster.list() (or whatever it's > > called) > > > on the magnum-python you're getting back a list of Cluster Python > objects > > > instead of a list of dictionaries. > > > > > > To fix the problem, you'll want to take the results of cluster.list() > and > > > translate it into a list of dictionaries, and then hand that off to > > > _translate_clusters. Probably you'll need to do the same for the > > > cluster_template. So instead of ... > > > > > > clusters_method = lambda: self._translate_clusters( > > >
Re: [openstack-dev] [Congress] Magnum_driver
Hi Ruben, Looked like there were still multiple changes, so I squashed them into 1 and fixed up the requirements.txt file. (You should only need to add the python-magnumclient to the requirements.txt file.) I also abandoned one that was incorporated into the one 1 fix. Here it is. Now the community should give you reviews. https://review.openstack.org/#/c/404222 Tim On Fri, Dec 9, 2016 at 3:06 PM Ruben wrote: > Hi Tim, > sorry for the late, but I've had a busy week. > Anyway, I've tried to add the magnum_driver to review into a single commit. > I don't know if I have been able.. > > Ruben > > - Messaggio originale - > Da: "Tim Hinrichs" > A: "Ruben" > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > timothy.l.hinri...@gmail.com> > Inviato: Mercoledì, 30 novembre 2016 22:04:32 > Oggetto: Re: [Congress] Magnum_driver > > Hi Ruben, > > What you're doing is correct. The downside is that it creates a new commit > for every change you make, and all of those commits show up on gerrit. In > OpenStack (and other projects I've seen that use Gerrit for code reviews) > you squash those commits into 1 change so that it's easier for reviewers to > see the change as a whole. (Projects that use Github for code reviews do > more like what you're doing now). To see your > > Here's a blog showing you what to do... > https://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one/ > > You can probably do > > $ git rebase -i > > and then follow the instructions in the blog that say you replace the > 'pick' for all the commits after the first with 'squash' (or 's' for > short). So something like the following. > > pick f392171 Added new feature X squash ba9dd9a Added new elements to page > design squash df71a27 Updated CSS for new elements > > After that, you should be able to do ... > > $ git review > > Tim > > On Wed, Nov 30, 2016 at 5:23 AM Ruben > wrote: > > > Hi Tim, > > what should I do to squash all the commits into a single one? > > > > To add the code to review I made: > > > > git add > > git commit > > git review > > > > Isn't it correct? > > > > Ruben > > > > - Messaggio originale - > > Da: "Tim Hinrichs" > > A: "Ruben" > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > timothy.l.hinri...@gmail.com> > > Inviato: Mercoledì, 30 novembre 2016 2:34:22 > > Oggetto: Re: [Congress] Magnum_driver > > > > Hi Ruben, > > > > I left a comment on one of the changes; after you take care of that I'll > > take a closer look at the code. Let me know if you have questions. > > > > Tim > > > > On Tue, Nov 29, 2016 at 4:06 AM Ruben > > wrote: > > > > > Hi Tim, > > > I've added the code of magnum_driver and its unit test to review. > > > It seems everything works. > > > > > > Ruben > > > > > > - Original Message - > > > From: "Tim Hinrichs" > > > To: "Ruben" > > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > > timothy.l.hinri...@gmail.com> > > > Sent: Saturday, November 26, 2016 12:48:12 AM > > > Subject: Re: [Congress] Magnum_driver > > > > > > Definitely push that code up into Gerrit so we can all take a look. > Data > > > like pods and containers is probably the most valuable data from > Magnum, > > so > > > I'd definitely recommend adding that. But push the code you have to > > Gerrit > > > first. (As long as you leave the ChangeId the same each time you push > to > > > Gerrit, Gerrit will keep all of the versions you pushed organized > > together, > > > yet keep the versions separate.) > > > > > > Tim > > > > > > On Fri, Nov 25, 2016 at 3:06 PM Ruben < > r.manganiel...@studenti.unisa.it> > > > wrote: > > > > > > > Hi Tim, > > > > You are great. It works! Thanks a lot! > > > > I've also solved the problem with py27. The unit test seems to work. > > > > The only thing that seems not to work is populate the > 'clusters_links' > > > and > > > > 'cluster_templates_links' tables: they are empty. > > > > Also, the 'labels' table is empty. > > > > I've no errors anyway. > > > > Are these problems according to you? > > > > > > > > Should I to try to add the translation of pods, containers and > > services? > > > > > > > > I've add the code to review. > > > > > > > > Ruben > > > > - Original Message - > > > > From: "Tim Hinrichs" > > > > To: "Ruben" > > > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > > > timothy.l.hinri...@gmail.com> > > > > Sent: Friday, November 25, 2016 10:36:29 PM > > > > Subject: Re: [Congress] Magnum_driver > > > > > > > > Hi Ruben, > > > > > > > > Glad you got that worked out. Once in a while I end up deleting my > > .tox > > > > dir because it gets out of date. I guess that's what the --recreate > > > option > > > > to tox does. So I learned something. :) > > > > > > > > The new error message looks to be saying that an object of type > > 'Cluster' > > > > cannot be iterated. Congress's _translate_clusters method assumes > that > > > > what you give it is basically JS
Re: [openstack-dev] [Congress] Magnum_driver
Hi Tim, thanks a lot for your help. I've seen that there is a failure for "gate-congress-pe-replicated-nv". It's strange because I didn't have failure before. So, what should I do now? Ruben - Messaggio originale - Da: "Tim Hinrichs" A: "Ruben" Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" Inviato: Lunedì, 12 dicembre 2016 19:58:24 Oggetto: Re: [Congress] Magnum_driver Hi Ruben, Looked like there were still multiple changes, so I squashed them into 1 and fixed up the requirements.txt file. (You should only need to add the python-magnumclient to the requirements.txt file.) I also abandoned one that was incorporated into the one 1 fix. Here it is. Now the community should give you reviews. https://review.openstack.org/#/c/404222 Tim On Fri, Dec 9, 2016 at 3:06 PM Ruben wrote: > Hi Tim, > sorry for the late, but I've had a busy week. > Anyway, I've tried to add the magnum_driver to review into a single commit. > I don't know if I have been able.. > > Ruben > > - Messaggio originale - > Da: "Tim Hinrichs" > A: "Ruben" > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > timothy.l.hinri...@gmail.com> > Inviato: Mercoledì, 30 novembre 2016 22:04:32 > Oggetto: Re: [Congress] Magnum_driver > > Hi Ruben, > > What you're doing is correct. The downside is that it creates a new commit > for every change you make, and all of those commits show up on gerrit. In > OpenStack (and other projects I've seen that use Gerrit for code reviews) > you squash those commits into 1 change so that it's easier for reviewers to > see the change as a whole. (Projects that use Github for code reviews do > more like what you're doing now). To see your > > Here's a blog showing you what to do... > https://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one/ > > You can probably do > > $ git rebase -i > > and then follow the instructions in the blog that say you replace the > 'pick' for all the commits after the first with 'squash' (or 's' for > short). So something like the following. > > pick f392171 Added new feature X squash ba9dd9a Added new elements to page > design squash df71a27 Updated CSS for new elements > > After that, you should be able to do ... > > $ git review > > Tim > > On Wed, Nov 30, 2016 at 5:23 AM Ruben > wrote: > > > Hi Tim, > > what should I do to squash all the commits into a single one? > > > > To add the code to review I made: > > > > git add > > git commit > > git review > > > > Isn't it correct? > > > > Ruben > > > > - Messaggio originale - > > Da: "Tim Hinrichs" > > A: "Ruben" > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > timothy.l.hinri...@gmail.com> > > Inviato: Mercoledì, 30 novembre 2016 2:34:22 > > Oggetto: Re: [Congress] Magnum_driver > > > > Hi Ruben, > > > > I left a comment on one of the changes; after you take care of that I'll > > take a closer look at the code. Let me know if you have questions. > > > > Tim > > > > On Tue, Nov 29, 2016 at 4:06 AM Ruben > > wrote: > > > > > Hi Tim, > > > I've added the code of magnum_driver and its unit test to review. > > > It seems everything works. > > > > > > Ruben > > > > > > - Original Message - > > > From: "Tim Hinrichs" > > > To: "Ruben" > > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > > timothy.l.hinri...@gmail.com> > > > Sent: Saturday, November 26, 2016 12:48:12 AM > > > Subject: Re: [Congress] Magnum_driver > > > > > > Definitely push that code up into Gerrit so we can all take a look. > Data > > > like pods and containers is probably the most valuable data from > Magnum, > > so > > > I'd definitely recommend adding that. But push the code you have to > > Gerrit > > > first. (As long as you leave the ChangeId the same each time you push > to > > > Gerrit, Gerrit will keep all of the versions you pushed organized > > together, > > > yet keep the versions separate.) > > > > > > Tim > > > > > > On Fri, Nov 25, 2016 at 3:06 PM Ruben < > r.manganiel...@studenti.unisa.it> > > > wrote: > > > > > > > Hi Tim, > > > > You are great. It works! Thanks a lot! > > > > I've also solved the problem with py27. The unit test seems to work. > > > > The only thing that seems not to work is populate the > 'clusters_links' > > > and > > > > 'cluster_templates_links' tables: they are empty. > > > > Also, the 'labels' table is empty. > > > > I've no errors anyway. > > > > Are these problems according to you? > > > > > > > > Should I to try to add the translation of pods, containers and > > services? > > > > > > > > I've add the code to review. > > > > > > > > Ruben > > > > - Original Message - > > > > From: "Tim Hinrichs" > > > > To: "Ruben" > > > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > > > timothy.l.hinri...@gmail.com> > > > > Sent: Friday, November 25, 2016 10:36:29 PM > > > > Subject: Re: [Congress] Magnum_driver > > > > > > > > Hi Ruben, > > > > > > > > Glad you got that worked out. O
Re: [openstack-dev] [Congress] Magnum_driver
That job is non-voting, which since you're adding a new datasource, you can ignore. Nothing to do now but wait for people to give you reviews. Tim On Mon, Dec 12, 2016 at 1:12 PM Ruben wrote: > Hi Tim, > thanks a lot for your help. > I've seen that there is a failure for "gate-congress-pe-replicated-nv". > It's strange because I didn't have failure before. > So, what should I do now? > > Ruben > > - Messaggio originale - > Da: "Tim Hinrichs" > A: "Ruben" > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > timothy.l.hinri...@gmail.com> > Inviato: Lunedì, 12 dicembre 2016 19:58:24 > Oggetto: Re: [Congress] Magnum_driver > > Hi Ruben, > > Looked like there were still multiple changes, so I squashed them into 1 > and fixed up the requirements.txt file. (You should only need to add the > python-magnumclient to the requirements.txt file.) I also abandoned one > that was incorporated into the one 1 fix. Here it is. Now the community > should give you reviews. > > https://review.openstack.org/#/c/404222 > > Tim > > > > > On Fri, Dec 9, 2016 at 3:06 PM Ruben > wrote: > > > Hi Tim, > > sorry for the late, but I've had a busy week. > > Anyway, I've tried to add the magnum_driver to review into a single > commit. > > I don't know if I have been able.. > > > > Ruben > > > > - Messaggio originale - > > Da: "Tim Hinrichs" > > A: "Ruben" > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > timothy.l.hinri...@gmail.com> > > Inviato: Mercoledì, 30 novembre 2016 22:04:32 > > Oggetto: Re: [Congress] Magnum_driver > > > > Hi Ruben, > > > > What you're doing is correct. The downside is that it creates a new > commit > > for every change you make, and all of those commits show up on gerrit. > In > > OpenStack (and other projects I've seen that use Gerrit for code reviews) > > you squash those commits into 1 change so that it's easier for reviewers > to > > see the change as a whole. (Projects that use Github for code reviews do > > more like what you're doing now). To see your > > > > Here's a blog showing you what to do... > > https://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one/ > > > > You can probably do > > > > $ git rebase -i > > > > and then follow the instructions in the blog that say you replace the > > 'pick' for all the commits after the first with 'squash' (or 's' for > > short). So something like the following. > > > > pick f392171 Added new feature X squash ba9dd9a Added new elements to > page > > design squash df71a27 Updated CSS for new elements > > > > After that, you should be able to do ... > > > > $ git review > > > > Tim > > > > On Wed, Nov 30, 2016 at 5:23 AM Ruben > > wrote: > > > > > Hi Tim, > > > what should I do to squash all the commits into a single one? > > > > > > To add the code to review I made: > > > > > > git add > > > git commit > > > git review > > > > > > Isn't it correct? > > > > > > Ruben > > > > > > - Messaggio originale - > > > Da: "Tim Hinrichs" > > > A: "Ruben" > > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > > timothy.l.hinri...@gmail.com> > > > Inviato: Mercoledì, 30 novembre 2016 2:34:22 > > > Oggetto: Re: [Congress] Magnum_driver > > > > > > Hi Ruben, > > > > > > I left a comment on one of the changes; after you take care of that > I'll > > > take a closer look at the code. Let me know if you have questions. > > > > > > Tim > > > > > > On Tue, Nov 29, 2016 at 4:06 AM Ruben < > r.manganiel...@studenti.unisa.it> > > > wrote: > > > > > > > Hi Tim, > > > > I've added the code of magnum_driver and its unit test to review. > > > > It seems everything works. > > > > > > > > Ruben > > > > > > > > - Original Message - > > > > From: "Tim Hinrichs" > > > > To: "Ruben" > > > > Cc: openstack-dev@lists.openstack.org, "timothy l hinrichs" < > > > > timothy.l.hinri...@gmail.com> > > > > Sent: Saturday, November 26, 2016 12:48:12 AM > > > > Subject: Re: [Congress] Magnum_driver > > > > > > > > Definitely push that code up into Gerrit so we can all take a look. > > Data > > > > like pods and containers is probably the most valuable data from > > Magnum, > > > so > > > > I'd definitely recommend adding that. But push the code you have to > > > Gerrit > > > > first. (As long as you leave the ChangeId the same each time you > push > > to > > > > Gerrit, Gerrit will keep all of the versions you pushed organized > > > together, > > > > yet keep the versions separate.) > > > > > > > > Tim > > > > > > > > On Fri, Nov 25, 2016 at 3:06 PM Ruben < > > r.manganiel...@studenti.unisa.it> > > > > wrote: > > > > > > > > > Hi Tim, > > > > > You are great. It works! Thanks a lot! > > > > > I've also solved the problem with py27. The unit test seems to > work. > > > > > The only thing that seems not to work is populate the > > 'clusters_links' > > > > and > > > > > 'cluster_templates_links' tables: they are empty. > > > > > Also, the 'labels' table is empty. > > > > > I've no errors anywa