#5838 batch command references non-existing variable 'principal' in context
Closed: Fixed None Opened 7 years ago by alich.

$ make rpms
 - SNIP -
Building IPA 4.3.90.201604211652GIT0472300
 - SNIP -

Pylint is running, please wait ...
************* Module ipalib.plugins.batch
ipalib/plugins/batch.py:110: [E1101(no-member), batch.execute] Instance of '_local' has no 'principal' member)
Makefile:132: recipe for target 'lint' failed
make: *** [lint] Error 1
 - SNIP -

Steps to reproduce:
1. git clone ...freeipa...
2. install dependencies
3. cd freeipa && make
4. make rpms


I found this yesterday, too.

This is a new problem detected by pylint-1.5.5-1.fc24.noarch.

Pylint is in fact right, I was able to trigger an error when calling a API command from early stages in the installer.

  [error] AttributeError: 'thread._local' object has no attribute 'principal'
ipa.ipapython.install.cli.install_tool(Server): ERROR    'thread._local' object has no attribute 'principal'
ipa.ipapython.install.cli.install_tool(Server): ERROR    The ipa-server-install command failed. See /var/log/ipaserver-install.log for more information

I will send a patch, the fix is obvious.

  • pspacek: easyfix, patch is on list
  • H: not a bug, actually - missing context.principal means wrong API usage
  • then our installers use API in a wrong way :-)
  • pv: fix or close?
  • we have to fix it anyway, because build is failing on F24
  • H: fix, but in the ldap2 plugin, which is supposed to set context.principal

The patch was incorrect, reseting.

It turns out that proper fix would be too hard so the original fix was re-sent for review.

The mess in context handling is quite horrible and impossible to untangle in short time we have for this.

master:

  • 89cdf6e Batch command: avoid accessing potentially undefined context.principal

ipa-4-2:

  • da06be4 Batch command: avoid accessing potentially undefined context.principal

ipa-4-3:

  • 2980e78 Batch command: avoid accessing potentially undefined context.principal

Metadata Update from @alich:
- Issue assigned to pspacek
- Issue set to the milestone: FreeIPA 4.2.5

7 years ago

Login to comment on this ticket.

Metadata