This commit is contained in:
Kloadut 2012-10-07 18:20:06 +02:00
parent ebf1e7d684
commit 7e701b03f9
2 changed files with 12 additions and 11 deletions

View file

@ -26,7 +26,7 @@ class YunoHostLDAP:
try:
self.conn.unbind_s()
except:
print(_('Error: A problem occured on LDAP unbind'))
print(msg.error + _('A problem occured on LDAP unbind'))
return False
else:
return True
@ -40,7 +40,7 @@ class YunoHostLDAP:
try:
result = self.conn.search_s(base, ldap.SCOPE_ONELEVEL, filter, attrs)
except Exception:
print(_('Error: An error occured on LDAP search'))
print(msg.error + _('An error occured on LDAP search'))
return False
if result:

View file

@ -17,7 +17,7 @@ __credits__ = """
You should have received a copy of the GNU Affero General Public License
along with this program; if not, see http://www.gnu.org/licenses
"""
__author__ = 'Kload'
__author__ = 'Kload <kload@kload.fr>'
__version__ = '2.0 beta1'
import sys
@ -102,7 +102,11 @@ def parse_args(parsers):
#argparse.ArgumentParser.add_argument
"""
# General
#####################
# General #
#####################
# Version
parsers['general'].add_argument(
'-v',
'--version',
@ -115,11 +119,7 @@ def parse_args(parsers):
#####################
# user list
parsers['user_list'].add_argument(
'-a',
'--all',
action='store'
)
parsers['user_list'].add_argument('-a', '--all', action='store_true')
# user add
parsers['user_add'].add_argument('-u', '--username')
@ -129,9 +129,10 @@ def parse_args(parsers):
parsers['user_add'].add_argument('-p', '--password')
# Call arguments parsing
#########################
# End of arguments #
#########################
args = parsers['general'].parse_args()
return args