Commit Graph

10151 Commits

Author SHA1 Message Date
Martin Basti
49b29591aa Pylint: remove unused variables in tests
Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-10-11 16:50:32 +02:00
Pavel Vomacka
51af7a1598 Add tooltip to all fields in DNS record adder dialog
In case that option is not documented or the doc string is the same as label, then no tooltip is shown.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-11 16:48:47 +02:00
Petr Spacek
bf96b80200 DNS: Improve field descriptions for SRV records
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-11 16:48:47 +02:00
Petr Spacek
f363dfbeed DNS: Support URI resource record type
https://fedorahosted.org/freeipa/ticket/6344

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-11 16:48:47 +02:00
Florence Blanc-Renaud
eb75578cbb Fix ipa-cacert-manage man page
When the admin runs ipa-cacert-manage install, he should also run
ipa-certupdate on master/replicas/clients in order to update the
certificates databases.

The man page should mention this requirement, and also clarify that
"install" command does not replace IPA CA but rather installs an
additional trusted CA.

https://fedorahosted.org/freeipa/ticket/6381

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-10-11 16:00:36 +02:00
Lenka Doudova
c3e3130a35 Tests: Fix failing test_ipalib/test_parameters
Parameters test fails because of KeyError caused by improper manipulation with
kwargs in Param.__init__ method. During initialization, if kwargs['required']
or kwargs['multivalue'] is None, it is delete from dictionary and hence the
missing key. Small change of the condition prevents this from happening.

Partially fixes https://fedorahosted.org/freeipa/ticket/6292

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-10-11 15:51:09 +02:00
Petr Spacek
8e02652e7c Fix compatibility with python-dns 1.15.0
From https://github.com/rthalley/dnspython/issues/214:
The FreeIPA code is directly invoking the TXT RR constructor instread
of calling dns.rdata.from_text(), which is how dnspython would like you
to do this kind of thing.

https://fedorahosted.org/freeipa/ticket/6390

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-11 15:45:41 +02:00
Fraser Tweedale
2b8163ab5d Add commentary about CA deletion to plugin doc
Add commentary to 'ca' plugin documentation to explain what happens
when a CA gets deleted - namely, that its signing cert gets revoked
and its private key deleted.

Also break the docstring up into smaller chunks to aid translation.

Fixes: https://fedorahosted.org/freeipa/ticket/6256
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-06 19:24:54 +02:00
Fraser Tweedale
6b3f498429 spec: require Dogtag >= 10.3.5-6
Require Dogtag 10.3.5-6, which is the first release that implements
revocation of lightweight CA signing certificates upon deletion.

Part of: https://fedorahosted.org/freeipa/ticket/6256

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-06 19:24:54 +02:00
Tomas Krizek
0dea726466 ipa: check if provided config file exists
Add a parser check to verify config file supplied to the ipa
command exists. Previously, invalid file paths would not results
in any error and would just silently proceed with default config.

https://fedorahosted.org/freeipa/ticket/6114

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-06 19:21:26 +02:00
Tomas Krizek
d7a2dfddbc ipa: allow relative paths for config file
Remove unnecessary check for absolute file paths for config file.

https://fedorahosted.org/freeipa/ticket/6114

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-06 19:21:26 +02:00
Lenka Doudova
74e52e8686 Tests: Remove silent deleting and creating entries by tracker
https://fedorahosted.org/freeipa/ticket/6123

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2016-10-06 19:16:37 +02:00
Martin Basti
135047d03c Pylint: remove unused variables in ipaserver package
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2016-10-06 10:43:36 +02:00
Martin Basti
d937588146 Pylint: remove unused variables from installers and scripts
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2016-10-06 10:43:36 +02:00
Christian Heimes
ac94d32c4f Add iSecStore.span
In the future Custodia is going to make CSStore.span an abstract method.

Closes: https://fedorahosted.org/freeipa/ticket/6365
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-06 10:39:15 +02:00
Nathaniel McCallum
0756ce7d53 Properly handle LDAP socket closures in ipa-otpd
In at least one case, when an LDAP socket closes, a read event is fired
rather than an error event. Without this patch, ipa-otpd silently
ignores this event and enters a state where all bind auths fail.

To remedy this problem, we pass error events along the same path as read
events. Should the actual read fail, we exit.

https://bugzilla.redhat.com/show_bug.cgi?id=1377858
https://fedorahosted.org/freeipa/ticket/6368

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2016-10-06 10:35:25 +02:00
Stanislav Laznicka
889f0863b8 Make installer quit more nicely on external CA installation
cainstance.__spawn_instance() exits in rather weird manner on
successful external CA install. This masks the weird implementation
from the user. :-&

https://fedorahosted.org/freeipa/ticket/6230

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-10-06 07:06:38 +02:00
Milan Kubík
10b4b155b6 ipatests: Implement tests with CSRs requesting SAN
The patch implements several test cases testing the enforcement
of CA ACLs on certificate requests with subject alternative names.

https://fedorahosted.org/freeipa/ticket/6366

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-10-04 18:03:03 +02:00
Milan Kubík
7eb78aa8db ipatests: Fix name property on a service tracker
https://fedorahosted.org/freeipa/ticket/6366

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-10-04 18:03:03 +02:00
Milan Kubík
4f8e212c42 ipatests: provide context manager for keytab usage in RPC tests
https://fedorahosted.org/freeipa/ticket/6366

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-10-04 18:03:03 +02:00
Petr Spacek
c56256e2a2 Raise errors from service.py:_ldap_mod() by default
This is to prevent situations when installer prints
CRITICAL Failed to load ....ldif
and continues just to crash later on because of non-existing LDAP container
or so on.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-04 14:14:30 +02:00
Stanislav Laznicka
d70d71846d Fix test_util.test_assert_deepequal test
The test would be failing because recent pretty-print changes
that caused the inner members of a dictionary to be printed
in a different order.

https://fedorahosted.org/freeipa/ticket/6373

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-10-04 14:11:00 +02:00
Martin Babinsky
ee96384c3e mod_nss: use more robust quoting of NSSNickname directive
The code which handles configuration of mod_nss module must be more robust
when handling NSS nicknames generated from subject names containing quoted RDN
values.

https://fedorahosted.org/freeipa/ticket/5809

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2016-10-03 13:42:34 +02:00
Martin Babinsky
4d994bee60 Move character escaping function to ipautil
Functions `escape_seq` and `unescape_seq` have a generic use-case so it makes
sense to move them from `kerberos` to ipautil module so that other modules can
reuse them more readily.

https://fedorahosted.org/freeipa/ticket/5809

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2016-10-03 13:42:34 +02:00
Martin Basti
95aa9369cb Fix: find OSCP certificate test
Test should check if any OSCP certificate has been returned

https://fedorahosted.org/freeipa/ticket/6359

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2016-09-30 13:13:57 +02:00
Stanislav Laznicka
ecd6cb4e45 Pretty-print structures in assert_deepequal
By default, ipa-run-tests will now pretty-print structures
compared in the assert_deepequal function. This behaviour
can be turned off by the --no-pretty-print option.

https://fedorahosted.org/freeipa/ticket/6212

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-09-30 09:55:58 +02:00
Pavel Vomacka
81ead980fb WebUI: hide buttons in certificate widget according to acl
When user is logged in and opens details page of another user there should not
be visible button for adding new certificate and also the option in action menu
for deleting certificate should be grayed out.

This is achieved by adding custom field for certificates widget, which is able to
read ACLs from result of user-show and not from cert-find result.

https://fedorahosted.org/freeipa/ticket/6341

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-09-29 11:14:02 +02:00
Martin Basti
45e3aee352 Pylint: enable check for unused-variables
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>
2016-09-27 13:35:58 +02:00
Martin Basti
9d83be3647 Remove unused variables in tests
This commit removes or marks unused variables as "expected to be unused"
by using '_' prefix.

Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2016-09-27 13:35:58 +02:00
Martin Basti
0f88f8fe88 Remove unused variables in the code
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>
2016-09-27 13:35:58 +02:00
Martin Basti
452b08754d test_text: add test ipa.pot file for tests
Input data should be packaged into freeipa-test module to be able run
test from RPM (outoftree)

https://fedorahosted.org/freeipa/ticket/6333

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-09-26 18:48:07 +02:00
Tomas Krizek
ef9c718e3a Prompt for forwarder in dnsforwardzone-add
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>
2016-09-26 18:45:49 +02:00
Martin Babinsky
f7764cda68 Make Continuous installer continuous only during execution phase
`common.Continuous` class is a basis for uninstallers, which should execute
all the steps regardless of occuring errors. However, we would like the
installer to raise exceptions and return non-zero exit code during validation
phase when some preconditions are not met.

Add a separate exception handler which catches exceptions and logs them as
errors during execution phase only.

https://fedorahosted.org/freeipa/ticket/5725

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-09-26 18:38:37 +02:00
Martin Babinsky
347f5ca0e1 use separate exception handlers for executors and validators
installer framework has been modified to allow for different error handling
during validation and execution phases.

https://fedorahosted.org/freeipa/ticket/5725

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-09-26 18:38:37 +02:00
Tomas Krizek
07ff1f619c Update man/help for --server option
The --server option now specifically mentions that
it expects the FQDN of the IPA server.

https://fedorahosted.org/freeipa/ticket/6202

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-09-23 15:04:53 +02:00
Fraser Tweedale
ff490b6c40 sudorule: add SELinux transition examples to plugin doc
It is not obvious how to add SELinux type and role transitions to a
Sudo rule.  Update the 'sudorule' plugin documentation with examples
of how to do this.

Fixes: https://fedorahosted.org/freeipa/ticket/3461
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2016-09-23 14:59:43 +02:00
Martin Basti
9b68d2a1f8 Pylint: enable global-variable-not-assigned check
the global keyword should be used only when variable from outside is
assigned inside, otherwise it has no effect and just confuses developers

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2016-09-23 09:23:41 +02:00
Martin Basti
4d7d53c966 Pylint: enable cyclic-import check
It looks that pylint stopped printing false positive errors for
cyclic-import check, thus check can be enabled.

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2016-09-23 09:23:41 +02:00
Fraser Tweedale
97d4ffc2dc Fix cert revocation when removing all certs via host/service-mod
When removing all host/service certificates via host/service-mod
--certificate=, the removed certificates should be revoked, but they
are not.  Examine whether the --certificate option was provided to
determine whether certs should be revoked, instead of looking for a
cert list in the options (which in this case is empty).

Fixes: https://fedorahosted.org/freeipa/ticket/6305
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-09-23 08:10:11 +02:00
Jan Barta
71b3352ad0 pylint: fix bad-mcs-method-argument
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Jan Barta
8420d04f38 pylint: fix bad-mcs-classmethod-argument
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Jan Barta
f252f50987 pylint: fix bad-classmethod-argument
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Jan Barta
9bc57a01e1 pylint: fix old-style-class
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Jan Barta
568f9da331 pylint: fix redefine-in-handler
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Jan Barta
cdecbcd0a1 pylint: fix pointless-statement
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Jan Barta
275e85d076 pylint: fix unneeded-not
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Jan Barta
36484e8672 pylint: fix simplifiable-if-statement warnings
fix inefficient if statements, enable pylint check

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
Martin Basti
929086e099 Test: dont use global variable for iteration in test_cert_plugin
Iteration over global variable causes unwanted value changes outside
method

https://fedorahosted.org/freeipa/ticket/5755

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-09-22 15:22:56 +02:00
Oleg Fayans
47c808afa3 tests: Fixed code styling in caless tests to make pep8 happy
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00
Oleg Fayans
9870c5804a tests: Reverted erroneous asserts in 4 tests
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-09-22 15:20:42 +02:00