#6490 Add local-env subcommand to ipa script
Closed: Fixed Opened by cheimes.

Let's see add a {{{local-env}}} subcommand to the ipa script to dump all local variables of api.env. It's a convenient helper for debugging and to write tests for features like IPA_CONFDIR


We already have command for that

$ ipa env
...
  container_ranges: cn=ranges,cn=etc
  container_realm_domains: cn=Realm Domains,cn=ipa,cn=etc
  container_rolegroup: cn=roles,cn=accounts
  container_roles: cn=roles,cn=policies
  container_s4u2proxy: cn=s4u2proxy,cn=etc
  container_selinux: cn=usermap,cn=selinux
  container_service: cn=services,cn=accounts
  container_stageuser: cn=staged users,cn=accounts,cn=provisioning
  container_sudocmd: cn=sudocmds,cn=sudo
  container_sudocmdgroup: cn=sudocmdgroups,cn=sudo
  container_sudorule: cn=sudorules,cn=sudo
  container_sysaccounts: cn=sysaccounts,cn=etc
  container_topology: cn=topology,cn=ipa,cn=etc
  container_trusts: cn=trusts
  container_user: cn=users,cn=accounts
  container_vault: cn=vaults,cn=kra
  container_views: cn=views,cn=accounts
  container_virtual: cn=virtual operations,cn=etc
  context: server
  debug: False
  delegate: False
  dogtag_version: 10
...

From https://github.com/freeipa/freeipa/pull/247#issuecomment-260944392

ipa env gets env vars from the server. ipa show_env gets only local settings. For example ipa env prints the LDAPI unix socket address for ldap_uri. Once the API schema bug is fixed, show_env won't even need a running server. show_env also prints the settings in a shell source compatible way.

master:

  • 1166fbc4946596fcc2ed51a1ec6990fc7dae8964 Add 'ipa localenv' subcommand

This command is entirely redundant. ipa env is supposed to return local settings unless executed with --server. It currently doesn't, but that's a bug which can and should be fixed.

Please revert this patch and fix the env command.

NACK

  • Please don't hijack a closed ticket and please don't turn a feature request into a bug report.
  • You can't change the actual meaning of an API call. Although it is documented to return local env, at least one place in FreeIPA depends on the fact that the env plugin returns remote env settings: https://github.com/freeipa/freeipa/blob/master/ipaserver/install/server/replicainstall.py#L503

Reopening a ticket in an unreleased milestone is not hijacking. Obviously all of the affected code needs to be fixed.

We don't close reopened tickets at will, we have ticket triage to decide that. Once again, please follow our process.

env command was fixed to behave as either local or RPC-forwarded call depending on presence of --server option. local-env patch has thus been reverted.

master:

  • 42307ae2dc4d9be06d3fd9b7e5af2e0761b8d6ad Revert "Add 'ipa localenv' subcommand"
  • 0ae7bebb7690620b69fd9c84b7a385c2086c1ee1 Make env and plugins commands local again
  • 64a4be26febf19e427760115912a858a804208a0 Fix pep-8 transgressions in ipalib/misc.p

Metadata Update from @cheimes:
- Issue assigned to someone
- Issue set to the milestone: FreeIPA 4.5

Metadata