summaryrefslogtreecommitdiffstats
path: root/ipaclient
Commit message (Collapse)AuthorAgeFilesLines
...
* client: extract checks from install to install_checkMartin Basti2016-11-111-20/+46
| | | | | | | | | client install contained installation check that have been moved to install_check function https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* client: move checks to client.install_checkMartin Basti2016-11-111-1/+20
| | | | | | | | Move checks from ipa-client-install to clien.install_check https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* client: make statestore and fstore consistent with serverMartin Basti2016-11-111-15/+18
| | | | | | | | | | | | There should not be mixed statestore as global variable and as local function parameter. This commit fixes usage of sysrestore and statestore as local variables only. In future we may need to change default statestore and fstore depending on where the functions are called and this change makes it easier and less error prone. https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* Separate function to purge IPA host principals from keytabMartin Babinsky2016-11-111-24/+31
| | | | | | | | | This functionality will be reused in the DL0 host enrollment https://fedorahosted.org/freeipa/ticket/6434 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* Replaced EMPTY_LINE constant with a function callStanislav Laznicka2016-11-112-28/+26
| | | | | | https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Martin Basti <mbasti@redhat.com>
* client: Making the configure functions more readableStanislav Laznicka2016-11-111-301/+84
| | | | | | https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Martin Basti <mbasti@redhat.com>
* IPAChangeConf: use constant for empty lineMartin Basti2016-11-112-84/+26
| | | | | | | | | Instead of copy&paste is better to use constant. It makes code shorter and improves readability, saves resources. https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* client: import IPAChangeConf directly instead the moduleMartin Basti2016-11-111-8/+8
| | | | | | | | | We should use as specific import as possible, better for python memory consumption and speed, and looks better in code. https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* client: remove extra return from hardcode_ldap_serverMartin Basti2016-11-111-2/+0
| | | | | | https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* client: install function: return constant not hardcoded numberMartin Basti2016-11-111-1/+1
| | | | | | https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* client: remove unneded return from configure_ipa_confMartin Basti2016-11-111-2/+0
| | | | | | | | | Function always returns return code 0, and this code is even not used elsewehere. https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* client: remove unneded return configure_krb5_confMartin Basti2016-11-111-25/+20
| | | | | | | | | Function configure_krb5_conf always returns 0 as return state. Remove the 'return' statement and let exceptions work https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* ipa-client-install: move client install to moduleMartin Basti2016-11-113-0/+3480
| | | | | | | | | This commit only moves the code from ipa-client-install to module ipaclient/install/client.py and fixes PEP8. https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* Build: Makefiles for Python packagesPetr Spacek2016-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This version builds only one version of Python packages. If you want to build for Python 2 & 3 call configure twice using different --with-python or specify PYTHON variable when calling make. dist-hook is using SOURCES.txt file from egg-info. According to Petr Viktorin this should be enough for our purposes and avoids need to create plugins for setuptools. Currently VPATH builds do not work for various reasons. This should be fixed later on. Most credit goes to these guys: Christian Heimes <cheimes@redhat.com> Petr Viktorin <pviktori@redhat.com> Kevin Brown <kevin@kevin-brown.com> https://fedorahosted.org/freeipa/ticket/6418 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com>
* ipaldap: merge IPAdmin to LDAPClientTomas Krizek2016-11-072-9/+9
| | | | | | | | | | | | | | | | * move IPAdmin methods to LDAPClient * add extra arguments (cacert, sasl_nocanon) to LDAPClient.__init__() * add host, port, _protocol to LDAPClient (parsed from ldap_uri) * create get_ldap_uri() method to create ldap_uri from former IPAdmin.__init__() arguments * replace IPAdmin with LDAPClient + get_ldap_uri() * remove ununsed function argument hostname from enable_replication_version_checking() https://fedorahosted.org/freeipa/ticket/6461 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* ipaldap: merge gssapi_bind to LDAPClientTomas Krizek2016-11-071-1/+1
| | | | | | | | | * Rename do_sasl_gssapi_bind to gssapi_bind https://fedorahosted.org/freeipa/ticket/6461 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* ipaldap: merge simple_bind into LDAPClientTomas Krizek2016-11-071-1/+1
| | | | | | | | | | | | * Use LDAPClient.simple_bind instead of extra call to IPAdmin.do_simple_bind * Rename binddn to bind_dn * Rename bindpw to bind_password * Explicitly specify bind_dn in all calls https://fedorahosted.org/freeipa/ticket/6461 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* Add __name__ == __main__ guards to setup.pysChristian Heimes2016-10-251-20/+20
| | | | | | | Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
* pylint: enable the import-error checkJan Cholasta2016-10-241-0/+2
| | | | | | | | | | Check for import errors with pylint to make sure new python package dependencies are not overlooked. https://fedorahosted.org/freeipa/ticket/6418 Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
* Port all setup.py to setuptoolsChristian Heimes2016-10-203-80/+50
| | | | | | | | | | | All setup.py files are now using setuptools through a common file ipasetup.py. The file is auto-generated and contain all common settings. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
* Move ipa.1 man fileChristian Heimes2016-10-171-1/+0
| | | | | | | | setuptools does not support data_files any more. The ipa(1) man page is now handled like the remaining man pages. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Petr Spacek <pspacek@redhat.com>
* Pylint: fix the rest of unused local variablesMartin Basti2016-10-111-2/+0
| | | | Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
* Pylint: remove unused variables from installers and scriptsMartin Basti2016-10-062-14/+2
| | | | Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* Pylint: enable check for unused-variablesMartin Basti2016-09-273-0/+6
| | | | | | | | | | | | | | | Unused variables may: * make code less readable * create dead code * potentialy hide issues/errors Enabled check should prevent to leave unused variable in code Check is locally disabled for modules that fix is not clear or easy or have too many occurences of unused variables Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com> Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* Remove unused variables in the codeMartin Basti2016-09-274-11/+5
| | | | | | | | | | | This commit removes unused variables or rename variables as "expected to be unused" by using "_" prefix. This covers only cases where fix was easy or only one unused variable was in a module Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com> Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* Prompt for forwarder in dnsforwardzone-addTomas Krizek2016-09-261-0/+5
| | | | | | | | | | When the command ipa dnsforwardzone-add is invoked without specifying the forwarder as an argument and the forward policy is not set to none, prompt for DNS forwarder. https://fedorahosted.org/freeipa/ticket/6169 Reviewed-By: Petr Spacek <pspacek@redhat.com>
* pylint: fix old-style-classJan Barta2016-09-221-1/+1
| | | | | Reviewed-By: Tomas Krizek <tkrizek@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
* Fix regression introduced in ipa-certupdateFlorence Blanc-Renaud2016-09-091-1/+4
| | | | | | | | The fix for 6288 was overwritten by commit 08b768313020c45bfa82d67cd214afabf605f4b3. https://fedorahosted.org/freeipa/ticket/6288 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
* schema cache: Store and check info for pre-schema serversDavid Kupka2016-09-063-91/+128
| | | | | | | | | | | | | Cache CommandError answer to schema command to avoid sending the command to pre-schema servers every time. This information expires after some time (1 hour) in order to start using schema as soon as the server is upgraded. https://fedorahosted.org/freeipa/ticket/6095 Signed-off-by: Jan Cholasta <jcholast@redhat.com> Signed-off-by: David Kupka <dkupka@redhat.com> Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
* dns: fix crash in interactive mode against old serversJan Cholasta2016-09-061-1/+61
| | | | | | | | | | Add a client-side fallback of the dnsrecord_split_parts command for old servers to avoid CommandError in dnsrecord_add and dnsrecord_mod CLI interactive mode. https://fedorahosted.org/freeipa/ticket/6203 Reviewed-By: Martin Basti <mbasti@redhat.com>
* dns: prompt for missing record parts in CLIJan Cholasta2016-09-061-14/+16
| | | | | | | | | Fix the code which determines if a record part is required and thus should be prompted not to wrongfully consider all record parts to be optional. https://fedorahosted.org/freeipa/ticket/6203 Reviewed-By: Martin Basti <mbasti@redhat.com>
* dns: normalize record type read interactively in dnsrecord_addJan Cholasta2016-09-061-0/+2
| | | | | | | | | | | | | When dnsrecord_add is called without options in interactive mode, it prompts the user to enter a record type. The record type is expected to be upper case further in the code, which causes non-upper case values not to work correctly. Fix this issue by upper casing the value after it is read. https://fedorahosted.org/freeipa/ticket/6203 Reviewed-By: Martin Basti <mbasti@redhat.com>
* Track lightweight CAs on replica installationFraser Tweedale2016-09-061-44/+9
| | | | | | | | | | Add Certmonger tracking requests for lightweight CAs on replica installation. As part of this change, extract most of the lightweight CA tracking code out of ipa-certupdate and into cainstance. Fixes: https://fedorahosted.org/freeipa/ticket/6019 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
* Fix ipa-certupdate for CA-less installationFlorence Blanc-Renaud2016-09-061-3/+4
| | | | | | | | | | | | | | | | | In a CA-less installation, ipa-certupdate fails with the error message: $ ipa-certupdate trying https://vm-180.abc.idm.lab.eng.brq.redhat.com/ipa/session/json Forwarding 'ca_is_enabled' to json server 'https://vm-180.abc.idm.lab.eng.brq.redhat.com/ipa/session/json' Forwarding 'ca_find/1' to json server 'https://vm-180.abc.idm.lab.eng.brq.redhat.com/ipa/session/json' CA is not configured The ipa-certupdate command failed. The issue happens because ipa-certupdate tries to call ca_find even on a CA_less deployment. The fix skips the call to ca_find in this case. https://fedorahosted.org/freeipa/ticket/6288 Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
* Handled empty hostname in server-del commandAbhijeet Kasurde2016-08-241-2/+6
| | | | | | | | Fixes: https://fedorahosted.org/freeipa/ticket/6248 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
* migrate-ds: Mention --enable-migration in error message about migration modePetr Spacek2016-08-221-1/+2
| | | | | | https://fedorahosted.org/freeipa/ticket/6234 Reviewed-By: Martin Basti <mbasti@redhat.com>
* Corrected minor spell check in AD Trust information doc messagesAbhijeet Kasurde2016-08-223-3/+3
| | | | | Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
* schema cache: Fallback to 'en_us' when locale is not availableDavid Kupka2016-08-181-3/+9
| | | | | | https://fedorahosted.org/freeipa/ticket/6204 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* compat: Fix ping command callDavid Kupka2016-08-171-1/+1
| | | | | | | | Remove extra argument from client.forward call. https://fedorahosted.org/freeipa/ticket/6095 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* schema check: Check current client language against cached oneDavid Kupka2016-08-171-1/+8
| | | | | | https://fedorahosted.org/freeipa/ticket/6204 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* schema cache: Read schema instead of rewriting it when SchemaUpToDateDavid Kupka2016-08-171-22/+24
| | | | | | https://fedorahosted.org/freeipa/ticket/6048 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* client: Do not create instance just to check isinstanceDavid Kupka2016-08-173-12/+11
| | | | | | | | | Checking that classes are idenical gives the same result and avoids unnecessary instantiation. https://fedorahosted.org/freeipa/ticket/6048 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* schema cache: Store API schema cache in memoryDavid Kupka2016-08-171-23/+28
| | | | | | | | | | Read whole cache into memory and keep it there for lifetime of api object. This removes the need to repetitively open/close the cache and speeds up every access to it. https://fedorahosted.org/freeipa/ticket/6048 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* schema cache: Read server info only onceDavid Kupka2016-08-171-10/+19
| | | | | | | | | Do not open/close the file with every access to plugins. Extensive access to filesystem may cause significant slowdown. https://fedorahosted.org/freeipa/ticket/6048 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* frontent: Add summary class property to CommandOverrideDavid Kupka2016-08-171-0/+6
| | | | | | | | Avoid creating instance of overriden command to get its summary. https://fedorahosted.org/freeipa/ticket/6048 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* Access data for help separatelyDavid Kupka2016-08-171-19/+18
| | | | | | | | | | To avoid the need to read all data for a plugin from cache and actualy use the separately stored help data it must be requested and returned separately. https://fedorahosted.org/freeipa/ticket/6048 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* schema cache: Do not read fingerprint and format from cacheDavid Kupka2016-08-171-26/+5
| | | | | | | | | | Fingerprint can be obtained from schema filename of from ServerInfo instance. Use FORMAT in path to avoid openening schema just to read its format. https://fedorahosted.org/freeipa/ticket/6048 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* schema cache: Do not reset ServerInfo dirty flagDavid Kupka2016-08-171-1/+2
| | | | | | | | | Once dirty flag is set to True it must not be set back to False. Otherwise changes are not written back to file. https://fedorahosted.org/freeipa/ticket/6048 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
* client: add missing output params to client-side commandsJan Cholasta2016-08-102-0/+30
| | | | | | | | | | | | Add output params for the otptoken-add-yubikey, vault-add, vault-mod, vault-archive and vault-retrieve commands. This fixes the commands not having any output in CLI. https://fedorahosted.org/freeipa/ticket/6182 Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: David Kupka <dkupka@redhat.com>
* parameters: move the `confirm` kwarg to ParamJan Cholasta2016-08-101-1/+1
| | | | | | | | | | | | | | | | | | | Whether a parameter is treated like password is determined by the `password` class attribute defined in the Param class. Whether the CLI will asks for confirmation of a password parameter depends on the value of the `confirm` kwarg of the Password class. Move the `confirm` kwarg from the Password class to the Param class, so that it can be used by any Param subclass which has the `password` class attribute set to True. This fixes confirmation of the --key option of otptoken-add, which is a Bytes subclass with `password` set to True. https://fedorahosted.org/freeipa/ticket/6174 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: David Kupka <dkupka@redhat.com>