mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add Requires on ipa-client to ipa-admintools, ensure ipa client is configured
It makes little sense to install ipa-admintools without ipa-client, require it. Also see if the client has been configured. This is a bit tricky since we have a full set of defaults. Add a new env option that gets set if at least one configuration file is loaded. ticket 213
This commit is contained in:
parent
264413bcb9
commit
0ceba59d87
@ -153,6 +153,7 @@ this package should be installed on every client machine.
|
|||||||
Summary: IPA administrative tools
|
Summary: IPA administrative tools
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Requires: %{name}-python = %{version}-%{release}
|
Requires: %{name}-python = %{version}-%{release}
|
||||||
|
Requires: %{name}-client = %{version}-%{release}
|
||||||
Requires: python-krbV
|
Requires: python-krbV
|
||||||
Requires: python-ldap
|
Requires: python-ldap
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ import frontend
|
|||||||
import backend
|
import backend
|
||||||
import plugable
|
import plugable
|
||||||
import util
|
import util
|
||||||
from errors import PublicError, CommandError, HelpError, InternalError, NoSuchNamespaceError, ValidationError, NotFound
|
from errors import PublicError, CommandError, HelpError, InternalError, NoSuchNamespaceError, ValidationError, NotFound, NotConfiguredError
|
||||||
from constants import CLI_TAB
|
from constants import CLI_TAB
|
||||||
from parameters import Password, Bytes, File
|
from parameters import Password, Bytes, File
|
||||||
from text import _
|
from text import _
|
||||||
@ -945,6 +945,8 @@ def run(api):
|
|||||||
api.register(klass)
|
api.register(klass)
|
||||||
api.load_plugins()
|
api.load_plugins()
|
||||||
api.finalize()
|
api.finalize()
|
||||||
|
if not 'config_loaded' in api.env:
|
||||||
|
raise NotConfiguredError()
|
||||||
sys.exit(api.Backend.cli.run(argv))
|
sys.exit(api.Backend.cli.run(argv))
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print ''
|
print ''
|
||||||
|
@ -389,6 +389,8 @@ class Env(object):
|
|||||||
if key not in self:
|
if key not in self:
|
||||||
self[key] = value
|
self[key] = value
|
||||||
i += 1
|
i += 1
|
||||||
|
if 'config_loaded' not in self: # we loaded at least 1 file
|
||||||
|
self['config_loaded'] = True
|
||||||
return (i, len(items))
|
return (i, len(items))
|
||||||
|
|
||||||
def _join(self, key, *parts):
|
def _join(self, key, *parts):
|
||||||
|
@ -746,6 +746,7 @@ class PasswordMismatch(InvocationError):
|
|||||||
errno = 3011
|
errno = 3011
|
||||||
format = _('Passwords do not match')
|
format = _('Passwords do not match')
|
||||||
|
|
||||||
|
|
||||||
class NotImplementedError(InvocationError):
|
class NotImplementedError(InvocationError):
|
||||||
"""
|
"""
|
||||||
**3012** Raise when a function hasn't been implemented.
|
**3012** Raise when a function hasn't been implemented.
|
||||||
@ -755,6 +756,15 @@ class NotImplementedError(InvocationError):
|
|||||||
format = _('Command not implemented')
|
format = _('Command not implemented')
|
||||||
|
|
||||||
|
|
||||||
|
class NotConfiguredError(InvocationError):
|
||||||
|
"""
|
||||||
|
**3013** Raise when there is no configuration
|
||||||
|
"""
|
||||||
|
|
||||||
|
errno = 3013
|
||||||
|
format = _('Client is not configured. Run ipa-client-install.')
|
||||||
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# 4000 - 4999: Execution errors
|
# 4000 - 4999: Execution errors
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user