summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-01-20 15:07:43 -0500
committerRob Crittenden <rcritten@redhat.com>2011-01-21 13:56:02 -0500
commit4361cd02422d8a6b30d67bb6869af9c67f7ec9c0 (patch)
tree706f815f0ae0cbb68649397e0949599d6e035e96
parent35f2f1d72078d69ca82b68f4d52bc61f2d297dfc (diff)
downloadfreeipa-4361cd02422d8a6b30d67bb6869af9c67f7ec9c0.tar.gz
freeipa-4361cd02422d8a6b30d67bb6869af9c67f7ec9c0.tar.xz
freeipa-4361cd02422d8a6b30d67bb6869af9c67f7ec9c0.zip
Rename INTERNAL to NO_CLI for commands we hide from the cli.
Also make i18n_messages and json_metadata NO_CLI. ticket 821
-rw-r--r--ipalib/cli.py6
-rw-r--r--ipalib/frontend.py4
-rw-r--r--ipalib/plugins/aci.py14
-rw-r--r--ipalib/plugins/batch.py2
-rw-r--r--ipalib/plugins/dns.py6
-rw-r--r--ipalib/plugins/internal.py4
-rw-r--r--ipalib/plugins/permission.py4
-rw-r--r--ipalib/plugins/privilege.py4
-rw-r--r--ipalib/plugins/pwpolicy.py12
9 files changed, 29 insertions, 27 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index dfc577c39..2cd3a97c3 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -656,7 +656,7 @@ class help(frontend.Local):
# build help topics
for c in self.Command():
- if c.INTERNAL:
+ if c.NO_CLI:
continue
topic = self._get_module_topic(c.module)
@@ -715,7 +715,7 @@ class help(frontend.Local):
mcl = max(len(s) for s in (self.Command))
for cname in self.Command:
cmd = self.Command[cname]
- if cmd.INTERNAL:
+ if cmd.NO_CLI:
continue
print '%s %s' % (to_cli(cmd.name).ljust(mcl), cmd.summary)
else:
@@ -886,7 +886,7 @@ class cli(backend.Executioner):
return
(key, argv) = (argv[0], argv[1:])
name = from_cli(key)
- if name not in self.Command or self.Command[name].INTERNAL:
+ if name not in self.Command or self.Command[name].NO_CLI:
raise CommandError(name=key)
cmd = self.Command[name]
if not isinstance(cmd, frontend.Local):
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index eeed3980c..567edfd17 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -220,8 +220,8 @@ class HasParam(Plugin):
that consider arbitrary ``api.env`` values.
"""
# HasParam is the base class for most frontend plugins, that make it to users
- # This flag should be used by UI components to make the plugin unaccessible
- INTERNAL = False
+ # This flag indicates that the command should not be available in the cli
+ NO_CLI = False
def _get_param_iterable(self, name, verb='takes'):
"""
diff --git a/ipalib/plugins/aci.py b/ipalib/plugins/aci.py
index 176495385..7f9b0f216 100644
--- a/ipalib/plugins/aci.py
+++ b/ipalib/plugins/aci.py
@@ -356,7 +356,7 @@ class aci(Object):
"""
ACI object.
"""
- INTERNAL = True
+ NO_CLI = True
label = _('ACIs')
@@ -428,7 +428,7 @@ class aci_add(crud.Create):
"""
Create new ACI.
"""
- INTERNAL = True
+ NO_CLI = True
msg_summary = _('Created ACI "%(value)s"')
takes_options = (
@@ -482,7 +482,7 @@ class aci_del(crud.Delete):
"""
Delete ACI.
"""
- INTERNAL = True
+ NO_CLI = True
has_output = output.standard_boolean
msg_summary = _('Deleted ACI "%(value)s"')
@@ -523,7 +523,7 @@ class aci_mod(crud.Update):
"""
Modify ACI.
"""
- INTERNAL = True
+ NO_CLI = True
has_output_params = (
Str('aci',
label=_('ACI'),
@@ -594,7 +594,7 @@ class aci_find(crud.Search):
have ipausers as a memberof. There may be other ACIs that apply to
members of that group indirectly.
"""
- INTERNAL = True
+ NO_CLI = True
msg_summary = ngettext('%(count)d ACI matched', '%(count)d ACIs matched', 0)
def execute(self, term, **kw):
@@ -752,7 +752,7 @@ class aci_show(crud.Retrieve):
"""
Display a single ACI given an ACI name.
"""
- INTERNAL = True
+ NO_CLI = True
has_output_params = (
Str('aci',
@@ -792,7 +792,7 @@ class aci_rename(crud.Update):
"""
Rename an ACI.
"""
- INTERNAL = True
+ NO_CLI = True
has_output_params = (
Str('aci',
label=_('ACI'),
diff --git a/ipalib/plugins/batch.py b/ipalib/plugins/batch.py
index f6f662f28..a5907791d 100644
--- a/ipalib/plugins/batch.py
+++ b/ipalib/plugins/batch.py
@@ -54,7 +54,7 @@ from ipalib.text import _
from ipapython.version import API_VERSION
class batch(Command):
- INTERNAL = True
+ NO_CLI = True
takes_args = (
List('methods?',
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index 6d2109741..69c38b26c 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -471,7 +471,7 @@ class dnsrecord_add_record(dnsrecord_mod_record):
"""
Add records to DNS resource.
"""
- INTERNAL = True
+ NO_CLI = True
def update_old_entry_callback(self, entry_attrs, old_entry_attrs):
for (a, v) in entry_attrs.iteritems():
@@ -509,7 +509,7 @@ class dnsrecord_delentry(LDAPDelete):
"""
Delete DNS record entry.
"""
- INTERNAL = True
+ NO_CLI = True
api.register(dnsrecord_delentry)
@@ -621,7 +621,7 @@ class dns_is_enabled(Command):
"""
Checks if any of the servers has the DNS service enabled.
"""
- INTERNAL = True
+ NO_CLI = True
has_output = output.standard_value
base_dn = 'cn=masters,cn=ipa,cn=etc,%s' % api.env.basedn
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index 89b2b4dd1..215131f07 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -35,7 +35,7 @@ class json_metadata(Command):
"""
Export plugin meta-data for the webUI.
"""
- INTERNAL = False
+ NO_CLI = True
takes_args = (
@@ -74,6 +74,8 @@ class json_metadata(Command):
api.register(json_metadata)
class i18n_messages(Command):
+ NO_CLI = True
+
messages={
"login": {"header" :_("Logged In As")},
"button":{
diff --git a/ipalib/plugins/permission.py b/ipalib/plugins/permission.py
index 43bb2634d..d3e0fd50a 100644
--- a/ipalib/plugins/permission.py
+++ b/ipalib/plugins/permission.py
@@ -368,7 +368,7 @@ class permission_add_member(LDAPAddMember):
"""
Add members to a permission.
"""
- INTERNAL = True
+ NO_CLI = True
api.register(permission_add_member)
@@ -377,6 +377,6 @@ class permission_remove_member(LDAPRemoveMember):
"""
Remove members from a permission.
"""
- INTERNAL = True
+ NO_CLI = True
api.register(permission_remove_member)
diff --git a/ipalib/plugins/privilege.py b/ipalib/plugins/privilege.py
index 124b7fc55..13e2b284e 100644
--- a/ipalib/plugins/privilege.py
+++ b/ipalib/plugins/privilege.py
@@ -127,7 +127,7 @@ class privilege_add_member(LDAPAddMember):
"""
Add members to a privilege
"""
- INTERNAL=True
+ NO_CLI=True
api.register(privilege_add_member)
@@ -136,7 +136,7 @@ class privilege_remove_member(LDAPRemoveMember):
"""
Remove members from a privilege
"""
- INTERNAL=True
+ NO_CLI=True
api.register(privilege_remove_member)
diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py
index f009a0c96..caf918c7a 100644
--- a/ipalib/plugins/pwpolicy.py
+++ b/ipalib/plugins/pwpolicy.py
@@ -70,7 +70,7 @@ class cosentry(LDAPObject):
"""
Class of Service object used for linking policies with groups
"""
- INTERNAL = True
+ NO_CLI = True
container_dn = 'cn=costemplates,%s' % api.env.container_accounts
object_class = ['top', 'costemplate', 'extensibleobject', 'krbcontainer']
@@ -113,7 +113,7 @@ api.register(cosentry)
class cosentry_add(LDAPCreate):
- INTERNAL = True
+ NO_CLI = True
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
# check for existence of the group
@@ -129,13 +129,13 @@ api.register(cosentry_add)
class cosentry_del(LDAPDelete):
- INTERNAL = True
+ NO_CLI = True
api.register(cosentry_del)
class cosentry_mod(LDAPUpdate):
- INTERNAL = True
+ NO_CLI = True
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
self.obj.check_priority_uniqueness(*keys, **options)
@@ -145,13 +145,13 @@ api.register(cosentry_mod)
class cosentry_show(LDAPRetrieve):
- INTERNAL = True
+ NO_CLI = True
api.register(cosentry_show)
class cosentry_find(LDAPSearch):
- INTERNAL = True
+ NO_CLI = True
api.register(cosentry_find)