Commit Graph

8985 Commits

Author SHA1 Message Date
Martin Basti
00fd28e026 Enable pylint unnecessary-pass check
Enables check and removes extra pass statement from code.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
ded70b6c6e Enable pylint empty-docstring check
Enables check and fixes:
************* Module ipalib.session
ipalib/session.py:671: [C0112(empty-docstring), SessionAuthManager]
Empty class docstring)
ipalib/session.py:705: [C0112(empty-docstring),
SessionAuthManager.logout] Empty method docstring)
************* Module ipalib.cli
ipalib/cli.py:364: [C0112(empty-docstring), textui.print_entry] Empty
method docstring)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
78254a9fdd Enable pylint expression-not-assigned check
Enables check and fixes:
************* Module ipa-replica-conncheck
install/tools/ipa-replica-conncheck:150:
[W0106(expression-not-assigned), parse_options] Expression
"(replica_group.add_option('-w', '--password', dest='password',
sensitive=True, help='Password for the principal'), )" is assigned to
nothing)
************* Module ipatests.test_xmlrpc.test_automount_plugin
ipatests/test_xmlrpc/test_automount_plugin.py:437:
[W0106(expression-not-assigned),
test_automount_indirect.test_1a_automountmap_add_indirect] Expression
"api.Command['automountmap_add_indirect'](self.locname, self.mapname,
**self.map_kw)['result']" is assigned to nothing)
************* Module ipatests.test_ipaserver.test_otptoken_import
ipatests/test_ipaserver/test_otptoken_import.py:128:
[W0106(expression-not-assigned), test_otptoken_import.test_mini]
Expression "[(t.id, t.options) for t in doc.getKeyPackages()]" is
assigned to nothing)
************* Module ipatests.test_ipaserver.test_ldap
ipatests/test_ipaserver/test_ldap.py:221:
[W0106(expression-not-assigned), test_LDAPEntry.test_popitem] Expression
"list(e) == []" is assigned to nothing)
************* Module ipa-client-install
ipa-client/ipa-install/ipa-client-install:114:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-p', '--principal', dest='principal',
help='principal to use to join the IPA realm'), )" is assigned to
nothing)
ipa-client/ipa-install/ipa-client-install:116:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-w', '--password', dest='password',
sensitive=True, help='password to join the IPA realm (assumes bulk
password unless principal is also set)'), )" is assigned to nothing)
ipa-client/ipa-install/ipa-client-install:118:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-k', '--keytab', dest='keytab', help='path to
backed up keytab from previous enrollment'), )" is assigned to nothing)
ipa-client/ipa-install/ipa-client-install:120:
[W0106(expression-not-assigned), parse_options] Expression
"(basic_group.add_option('-W', dest='prompt_password',
action='store_true', default=False, help='Prompt for a password to join
the IPA realm'), )" is assigned to nothing)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
9f49246476 Enable pylint unused-format-string-key check
Enables check and fixes:
ipatests/test_xmlrpc/test_permission_plugin.py:534:
[W1301(unused-format-string-key), test_permission] Unused key 'tdn' in
format string dictionary)
ipatests/test_xmlrpc/test_permission_plugin.py:652:
[W1301(unused-format-string-key), test_permission] Unused key 'tdn' in
format string dictionary)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
81ff72b9af Enable pylint missing-final-newline check
Enables check and fixes:
ipaserver/install/otpdinstance.py:25: [C0304(missing-final-newline), ]
Final newline missing)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
1f6b1c2de7 Enable pylint trailing-whitespace check
Enables check and fixes:
************* Module ipapython.log_manager
ipapython/log_manager.py:808: [C0303(trailing-whitespace), ] Trailing
whitespace)
************* Module ipachangeconf
contrib/RHEL4/ipachangeconf.py:28: [C0303(trailing-whitespace), ]
Trailing whitespace)
contrib/RHEL4/ipachangeconf.py:116: [C0303(trailing-whitespace), ]
Trailing whitespace)
************* Module ipalib.plugins.pwpolicy
ipalib/plugins/pwpolicy.py:174: [C0303(trailing-whitespace), ] Trailing
whitespace)
ipalib/plugins/pwpolicy.py:180: [C0303(trailing-whitespace), ] Trailing
whitespace)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
89e16a8053 Enable pylint duplicated-key check
Enables check and fixes:
ipatests/test_xmlrpc/test_permission_plugin.py:65:
[W0109(duplicate-key), ] Duplicate key 'ipapermlocation' in dictionary)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
fb3eab7ec7 Enable pylint lost exception check
Commit enables check and also fixes:
ipaserver/dcerpc.py:718: [W0150(lost-exception),
DomainValidator.__search_in_dc] return statement in finally block may
swallow exception)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
837e8f8160 Enable multiple warnings checks in Pylint
Enable more checks in pylint. Currently disabled checks are check that
we do not want, or issues are already in code.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
e1192ebd97 Remove wildcard imports
Wildcard imports should not be used.

Check for wildcard imports has been enabled in pylint.
Pylint note: options 'wildcard-import' causes too much false positive
results, so instead it I used 'unused-wildcard-import' option which has almost
the same effect.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
e4075b1fe2 Remove unused imports
This patch removes unused imports, alse pylint has been configured to
check unused imports.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
774d0eaa8e Remove empty test file
This test file has not been used

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
fba70a0346 Use module variables for timedate_services
Explicitly store timedate services in module variable is safer than
doind just unused import.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:57:55 +01:00
Martin Basti
403652b5b9 Fix: replace mkdir with chmod
In original patches, extra mkdir has been added instead of chmod.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-22 16:40:45 +01:00
David Kupka
8ad39a974f ipa-dns-install: Do not check for zone overlap when DNS installed.
When DNS is already installed somewhere in topology we should not check for
zone overlap because it would always say that we are overlapping our own domain.
ipa-replica-install already does that but ipa-dns-install did not.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-12-22 16:04:14 +01:00
Martin Basti
91913c5ba7 Fix version comparison
Use RPM library to compare vendor versions of IPA for redhat platform

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-22 14:08:41 +01:00
Martin Basti
e622da3e1a Remove unused code in server installer related to KRA
The first instance of KRA system should be allowed to install only by ipa-kra-install. This commit removes TODO and unneeded parts in code.

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-12-22 14:05:55 +01:00
David Kupka
f0703d3c2a installer: Fix logic of reading option values from cache.
Only options explicitly set must be stored before installer exits first step
of external CA setup. When installer continues all stored option values must
be restored.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-21 18:37:32 +01:00
David Kupka
30fbc7e948 installer: Propagate option values from components instead of copying them.
https://fedorahosted.org/freeipa/ticket/5556

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-21 18:37:32 +01:00
Oleg Fayans
b12ba14e3d CI tests: Added domain realm as a parameter to master installation in integration tests
Without realm provided explicitly, installation calculates it automatically
from the current hostname which may be inconsistent with the configured domain
name. Which, in turn, causes failures in integration tests in the lab.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-21 15:10:56 +01:00
Oleg Fayans
36e85b10db CI tests: Enabled automatic creation of reverse zone during master installation
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-21 15:01:21 +01:00
Milan Kubik
c8a0359362 ipatests: Roll back the forwarder config after a test case
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-12-21 14:08:29 +01:00
Martin Basti
ee51ad0f25 Fix DNS tests: dns-resolve returns warning
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-12-21 14:07:12 +01:00
Martin Babinsky
66de9a6c9b harden domain level 1 topology connectivity checks
this patch makes the check_last_link_managed() function more resistant to both
orphaned topology suffixes and also to cases when there are IPA masters do not
seem to manage any suffix. The function will now only complain loudly about
these cases and not cause crashes.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-21 12:12:04 +01:00
Martin Babinsky
cd5fa38945 raise more descriptive Backend connection-related exceptions
https://fedorahosted.org/freeipa/ticket/5473

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-21 12:05:23 +01:00
Milan Kubík
aa648bcedc ipatests: replace the test-example.com domain in tests
Latest DNS patches introduced checks for the added zones.
If a zone exists, the add fails if not forced. The domain
test-example.com is resolvable thus causing errors in the test.

Also adds missing __init__.py to the ipatests.test_cmdline package.

Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2015-12-17 15:15:28 +01:00
Petr Viktorin
53b60546e4 Package ipapython, ipalib, ipaplatform, ipatests for Python 3
Running make with PYTHON=/usr/bin/python3 will build/install the
bits for Python 3.

Executable scripts in ipatests have symlinks Python version suffixes
as per Fedora guidelines. Suffix-less names point to the Python 2 versions.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-17 10:52:57 +01:00
Petr Spacek
58331208a5 dns: Handle SERVFAIL in check if domain already exists.
In cases where domain is already delegated to IPA prior installation
we might get timeout or SERVFAIL. The answer depends on the recursive
server we are using for the check.

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-12-16 15:25:53 +01:00
Jan Cholasta
c265e8736e ipautil: remove unused import causing cyclic import in tests
https://fedorahosted.org/freeipa/ticket/5551
2015-12-15 15:37:10 +01:00
Petr Vobornik
fbc7a6e5f5 Bump 4.4 development version to 4.3.90 2015-12-14 23:30:59 +01:00
Petr Vobornik
792c965075 Become IPA 4.3.0 2015-12-14 23:20:54 +01:00
David Kupka
1534061d9b dns: Add --auto-reverse option.
Introducing '--auto-reverse' option. When specified reverse records for
all server's IP addresses are checked and when record nor reverse zone
does not exist reverse zone is created.

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-12-14 18:53:53 +01:00
David Kupka
8d19da49c4 dns: Check if domain already exists.
Raise an error when the domain already exists. This can be overriden using
--force or --allow-zone-overlap options.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-12-14 18:53:53 +01:00
David Kupka
6c107d819c dns: do not add (forward)zone if it is already resolvable.
Check if the zone user wants to add is already resolvable and refuse to
create it if yes. --skip-overlap-check and --force options suppress this check.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-12-14 18:53:53 +01:00
Martin Babinsky
5886f87f97 ipa-client-install: create a temporary directory for ccache files
gssapi.Credentials instantiation in ipautil.kinit_keytab() raises 'Bad format
in credential cache' error when a name of an existing zero-length file is
passed as a ccache parameter. Use temporary directory instead and let GSSAPI
to create file-based ccache on demand.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 18:50:38 +01:00
Martin Babinsky
c4b9b295d8 CI tests: remove '-p' option from ipa-dns-install calls
fix for https://fedorahosted.org/freeipa/ticket/4933 made ipa-dns-install to
use LDAPI and deprecated -p option for directory manager password. This patche
remove the option from calls to ipa-dns-install in CI tests so that
deprecation warning does not clutter the logs.

Reviewed-By: Milan Kubik <mkubik@redhat.com>
2015-12-14 15:41:28 +01:00
Jan Cholasta
110e3dfc54 replica promotion: let ipa-client-install validate enrollment options
ipa-client-install output is redirected to standard output, so let it print
its own error message for missing options.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 15:38:32 +01:00
Martin Basti
4272ba40ea Explicitly call chmod on newly created directories
Without calling os.chmod(), umask is effective and may cause that
directory is created with permission that causes failure.

This can be related to https://fedorahosted.org/freeipa/ticket/5520

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:57:26 +01:00
Martin Basti
5e2cd38ab9 DNS: fix file permissions
With non default umask named-pkcs11 cannot access the softhsm token storage

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:57:26 +01:00
Jan Cholasta
c856401478 server install: redirect ipa-client-install output to standard output
https://fedorahosted.org/freeipa/ticket/5527

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:46:45 +01:00
Jan Cholasta
f49cdfe392 ipautil: allow redirecting command output to standard output in run()
https://fedorahosted.org/freeipa/ticket/5527

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:46:45 +01:00
Jan Cholasta
b248dfda39 ca install: use host credentials in domain level 1
https://fedorahosted.org/freeipa/ticket/5399

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-14 14:40:17 +01:00
Jan Cholasta
6ea868e172 aci: merge domain and CA suffix replication agreement ACIs
Merge the two identical sets of replication agreement permission ACIs for
the domain and CA suffixes into a single set suitable for replication
agreements for both suffixes. This makes the replication agreement
permissions behave correctly during CA replica install, so that any
non-admin user with the proper permissions (such as members of the
ipaservers host group) can set up replication for the CA suffix.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-14 14:40:17 +01:00
Fraser Tweedale
38861428e7 dogtaginstance: remove unused function 'check_inst'
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:32:36 +01:00
Jan Cholasta
d68613194b replica promotion: notify user about ignoring client enrollment options
When IPA client is already installed, notify the user that the enrollment
options are ignored in ipa-replica-install.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:23:37 +01:00
Martin Basti
e1cb802d15 Tests: test_ipagetkeytab: fix assert that is always true
Fixes:
/usr/lib/python2.7/site-packages/ipatests/test_cmdline/test_ipagetkeytab.py:116:
SyntaxWarning: assertion is always true, perhaps remove parentheses?
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:22:30 +01:00
David Kupka
8b1002a18c spec file: Add dbus-python to BuildRequires
Commit 8d7f67e introduced the need for dbus-python during build time.

https://fedorahosted.org/freeipa/ticket/5497
2015-12-14 13:38:52 +01:00
Petr Spacek
e650e5eda1 Makefile: disable parallel build
IPA build system cannot cope with parallel build anyway, so this patch
disables parallel build explicitly so it does not blow up when user
has -j specified in default MAKEOPTS.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 12:33:34 +01:00
David Kupka
8112ac69cc test: Temporarily increase timeout in vault test.
Remove this change when vault is fixed.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-14 11:52:20 +01:00
Martin Basti
bf9a34f4cf Install RA cert during replica promotion
This cert is needed with KRA to be able store and retrieve secrets.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-12-14 11:48:40 +01:00