<div dir="ltr">This error happens happens when the translator thinks there's an object/dictionary when in actuality there's just a string.  I don't know of a good way to know where in the translator the problem is, other than simplifying the input and the translator and rerunning (which you're already doing).<div><br></div><div>Tim<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 15, 2017 at 12:52 AM Carmine Annunziata <<a href="mailto:carmine.annunziata02@gmail.com">carmine.annunziata02@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi everyone,<div><div style="font-size:12.8px">I wrote a congress datasource driver and its unit test for designate, but i got the following errors in the method test_update_from_datasource. It's something wrong in the translation.<br></div><span style="font-size:12.8px">Here is the traceback:</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px"> File "congress/tests/datasources/</span><span style="font-size:12.8px">test_designate_driver.py", line 34, in setUp</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self.driver = designate_driver.</span><span style="font-size:12.8px">DesignateDriver(args=args)</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">designate_driver.py", line 150, in __init__</span><br style="font-size:12.8px"><span style="font-size:12.8px">    super(DesignateDriver, self).__init__(name, args=args)</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">datasource_driver.py", line 1282, in __init__</span><br style="font-size:12.8px"><span style="font-size:12.8px">    super(PollingDataSourceDriver, self).__init__(name, args=args)</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">datasource_driver.py", line 324, in __init__</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self.initialize_translators()</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">datasource_driver.py", line 1324, in initialize_translators</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self.register_translator(</span><span style="font-size:12.8px">translator)</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">datasource_driver.py", line 457, in register_translator</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self._validate_translator(</span><span style="font-size:12.8px">translator, related_tables)</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">datasource_driver.py", line 446, in _validate_translator</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self._validate_by_translation_</span><span style="font-size:12.8px">type(translator, related_tables)</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">datasource_driver.py", line 428, in _validate_by_translation_type</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self._validate_hdict_type(</span><span style="font-size:12.8px">translator, related_tables)</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">datasource_driver.py", line 389, in _validate_hdict_type</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self._validate_translator(</span><span style="font-size:12.8px">subtranslator, related_tables)</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">datasource_driver.py", line 446, in _validate_translator</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self._validate_by_translation_</span><span style="font-size:12.8px">type(translator, related_tables)</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">datasource_driver.py", line 428, in _validate_by_translation_type</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self._validate_hdict_type(</span><span style="font-size:12.8px">translator, related_tables)</span><br style="font-size:12.8px"><span style="font-size:12.8px">  File "congress/datasources/</span><span style="font-size:12.8px">datasource_driver.py", line 386, in _validate_hdict_type</span><br style="font-size:12.8px"><span style="font-size:12.8px">    self.check_params(field_</span><span style="font-size:12.8px">translator.keys(),</span><br style="font-size:12.8px"><span style="font-size:12.8px">AttributeError: 'str' object has no attribute 'keys'</span><br clear="all"><div><br></div><div>Thank you,</div><div class="m_-3079195463740082883gmail_signature"><div dir="ltr">Carmine</div></div>
</div></div>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div></div></div>