hostgroup: Selected PEP8 fixes for the hostgroup plugin

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Tomas Babej 2014-08-01 12:15:07 +02:00 committed by Martin Kosek
parent ce42bf282f
commit 6e94d23a92

View File

@ -67,6 +67,7 @@ def get_complete_hostgroup_member_list(hostgroup):
register = Registry() register = Registry()
@register() @register()
class hostgroup(LDAPObject): class hostgroup(LDAPObject):
""" """
@ -177,7 +178,6 @@ class hostgroup(LDAPObject):
entry_attrs['memberof'].remove(member) entry_attrs['memberof'].remove(member)
@register() @register()
class hostgroup_add(LDAPCreate): class hostgroup_add(LDAPCreate):
__doc__ = _('Add a new hostgroup.') __doc__ = _('Add a new hostgroup.')
@ -197,9 +197,9 @@ class hostgroup_add(LDAPCreate):
# when enabled, a managed netgroup is created for every hostgroup # when enabled, a managed netgroup is created for every hostgroup
# make sure that the netgroup can be created # make sure that the netgroup can be created
api.Object['netgroup'].get_dn_if_exists(keys[-1]) api.Object['netgroup'].get_dn_if_exists(keys[-1])
raise errors.DuplicateEntry(message=unicode(_(\ raise errors.DuplicateEntry(message=unicode(_(
u'netgroup with name "%s" already exists. ' \ u'netgroup with name "%s" already exists. '
u'Hostgroups and netgroups share a common namespace'\ u'Hostgroups and netgroups share a common namespace'
) % keys[-1])) ) % keys[-1]))
except errors.NotFound: except errors.NotFound:
pass pass
@ -217,8 +217,6 @@ class hostgroup_add(LDAPCreate):
return dn return dn
@register() @register()
class hostgroup_del(LDAPDelete): class hostgroup_del(LDAPDelete):
__doc__ = _('Delete a hostgroup.') __doc__ = _('Delete a hostgroup.')
@ -226,7 +224,6 @@ class hostgroup_del(LDAPDelete):
msg_summary = _('Deleted hostgroup "%(value)s"') msg_summary = _('Deleted hostgroup "%(value)s"')
@register() @register()
class hostgroup_mod(LDAPUpdate): class hostgroup_mod(LDAPUpdate):
__doc__ = _('Modify a hostgroup.') __doc__ = _('Modify a hostgroup.')
@ -239,7 +236,6 @@ class hostgroup_mod(LDAPUpdate):
return dn return dn
@register() @register()
class hostgroup_find(LDAPSearch): class hostgroup_find(LDAPSearch):
__doc__ = _('Search for hostgroups.') __doc__ = _('Search for hostgroups.')
@ -257,7 +253,6 @@ class hostgroup_find(LDAPSearch):
return truncated return truncated
@register() @register()
class hostgroup_show(LDAPRetrieve): class hostgroup_show(LDAPRetrieve):
__doc__ = _('Display information about a hostgroup.') __doc__ = _('Display information about a hostgroup.')
@ -268,7 +263,6 @@ class hostgroup_show(LDAPRetrieve):
return dn return dn
@register() @register()
class hostgroup_add_member(LDAPAddMember): class hostgroup_add_member(LDAPAddMember):
__doc__ = _('Add members to a hostgroup.') __doc__ = _('Add members to a hostgroup.')
@ -279,7 +273,6 @@ class hostgroup_add_member(LDAPAddMember):
return (completed, dn) return (completed, dn)
@register() @register()
class hostgroup_remove_member(LDAPRemoveMember): class hostgroup_remove_member(LDAPRemoveMember):
__doc__ = _('Remove members from a hostgroup.') __doc__ = _('Remove members from a hostgroup.')