rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
self.configuration.groups.names['plural'])): | self.configuration.groups.names['plural'])) \ or home.find('/tmp') != -1: | def validate_home_dir(home=home, login=login, system=system, force=force): """ Do some basic but sane tests on the home dir provided. """ | b410e15f1096285bc18bb2325c5ae83b8b5aefbb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b410e15f1096285bc18bb2325c5ae83b8b5aefbb/users.py |
'''%s is outside %s and /var, or inside %s/%s. ''' | '''%s is outside %s and /var, or inside %s/%s ''' '''and a temporary directory (/var/tmp, /tmp). ''' | def validate_home_dir(home=home, login=login, system=system, force=force): """ Do some basic but sane tests on the home dir provided. """ | b410e15f1096285bc18bb2325c5ae83b8b5aefbb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b410e15f1096285bc18bb2325c5ae83b8b5aefbb/users.py |
def clear_term(): sys.stdout.write(clear) sys.stdout.flush() | 68ddcd089decd22f0c14469b85d4c5afbbd34f54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/68ddcd089decd22f0c14469b85d4c5afbbd34f54/core.py | ||
def cmdfmt(cmd): '''convert a sequence to a colorized string.''' return styles.stylize(styles.ST_NAME, ' '.join(cmd)) | 68ddcd089decd22f0c14469b85d4c5afbbd34f54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/68ddcd089decd22f0c14469b85d4c5afbbd34f54/core.py | ||
def test_message(msg): """ display a message to stderr. """ sys.stderr.write("%s>>> %s%s\n" % (styles.colors[styles.ST_LOG], msg, styles.colors[styles.ST_NO]) ) | 68ddcd089decd22f0c14469b85d4c5afbbd34f54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/68ddcd089decd22f0c14469b85d4c5afbbd34f54/core.py | ||
def log_and_exec (command, inverse_test=False, result_code=0, comment="", verb=verbose): """Display a command, execute it, and exit if soemthing went wrong.""" #if not command.startswith('colordiff'): # command += ' %s' % ' '.join(args) sys.stderr.write("%s>>> running %s%s%s\n" % (styles.colors[styles.ST_LOG], styles... | 68ddcd089decd22f0c14469b85d4c5afbbd34f54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/68ddcd089decd22f0c14469b85d4c5afbbd34f54/core.py | ||
def strip_dates(str): """ strip dates from warnings and traces, else outputs and references always compare false .""" return re.sub(r'\s\[\d\d\d\d/\d\d/\d\d\s\d\d:\d\d:\d\d\.\d\d\d\d\]\s', r' [D/T] ', str) | 68ddcd089decd22f0c14469b85d4c5afbbd34f54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/68ddcd089decd22f0c14469b85d4c5afbbd34f54/core.py | ||
make_path = lambda x: ('_'.join(x)).replace('../', '').replace('//','_').replace('/','_') | make_path = lambda x: ('_'.join(x)).replace('__', '_').replace( './', '').replace('../', '').replace('//','_').replace( '/','_').replace('>','').replace('&', '') | def Prepare(self, cmd): """ Run commands mandatory for func_test to succeed. """ | 68ddcd089decd22f0c14469b85d4c5afbbd34f54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/68ddcd089decd22f0c14469b85d4c5afbbd34f54/core.py |
logging.warning('command "%s" failed (retcode %d instead of %d).\nPath: %s' % ( cmdfmt(cmd), retcode, ref_code, self.ref_code_file)) | logging.warning( '''command "%s" failed (retcode %d instead of %d).\n''' '''(Reference path: %s)''' % ( styles.stylize(styles.ST_NAME, cmdfmt(cmd)), styles.stylize(styles.ST_BAD,retcode), styles.stylize(styles.ST_OK, ref_code), self.ref_code_file)) | def RunAndCheck(self, cmd, batch = False, inverse_test=False): ref_output, ref_code = self.PrepareReferenceOutput(cmd) | 68ddcd089decd22f0c14469b85d4c5afbbd34f54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/68ddcd089decd22f0c14469b85d4c5afbbd34f54/core.py |
gid = manual_gid | if (system and GroupsController.is_system_gid(manual_gid)) \ or (not system and GroupsController.is_standard_gid( manual_gid)): gid = manual_gid else: raise exceptions.BadArgumentError('''GID out of range ''' '''for the kind of group you specified. System GID ''' '''must be between %d and %d, standard GID must be ''' '... | def __add_group(self, name, system, manual_gid=None, description = "", groupSkel = "", batch=False, force=False): """ Add a POSIX group, write the system data files. Return the gid of the group created.""" | f0e4c86365a195e4a5db9a817af2516760012569 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f0e4c86365a195e4a5db9a817af2516760012569/groups.py |
return (w.HTTP_TYPE_TEXT, w.page(title, w.error(_("Forbidden action"), | return (HTTP_TYPE_TEXT, page(title, error(_("Forbidden action"), | def forgery_error(title): return (w.HTTP_TYPE_TEXT, w.page(title, w.error(_("Forbidden action"), [ _("Some parts of the system cannot be modified.") ], _("insufficient permissions to perform operation.")))) | 1630a65f4364354de82f4b2bcfdc9d564e55ac6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1630a65f4364354de82f4b2bcfdc9d564e55ac6e/utils.py |
title = _("Showing details of group %s") % name data = '%s\n%s\n%s\n' % (w.backto(), __groups_actions(), w.menu(uri)) | title = _("Details of group %s") % name data = w.page_body_start(uri, http_user, ctxtnav, title) | def view(uri, http_user, name): """Prepare a group view to be printed.""" users.reload() groups.reload() title = _("Showing details of group %s") % name data = '%s\n%s\n%s\n' % (w.backto(), __groups_actions(), w.menu(uri)) u = users.users g = groups.groups # TODO: should we forbid system group view ? why not ? # A... | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py |
members.sort() members_html = ''' <h2>%s</h2><div style="text-align:center;">%s</div> <table class="group_members"> <tr> <td><strong>%s</strong></td> <th><strong>%s</strong></th> <th><strong>%s</strong></th> </tr> ''' % (_('Members'), _('(ordered by login)'), _('Full Name'), _('Identifier'), _('UID')) def user_line(lo... | if members != []: members.sort() members_html = ''' <h2>%s</h2> <div style="text-align:left;">%s</div> <table class="group_members"> <tr> <th><strong>%s</strong></th> <th><strong>%s</strong></th> <th><strong>%s</strong></th> </tr> ''' % ( _('Members'), _('(ordered by login)'), _('Full Name'), _('Identifier'), _('UID'... | def view(uri, http_user, name): """Prepare a group view to be printed.""" users.reload() groups.reload() title = _("Showing details of group %s") % name data = '%s\n%s\n%s\n' % (w.backto(), __groups_actions(), w.menu(uri)) u = users.users g = groups.groups # TODO: should we forbid system group view ? why not ? # A... | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py |
resps = groups.all_members(configuration.groups.resp_prefix + name) resps.sort() guests = \ groups.all_members(configuration.groups.guest_prefix + name) guests.sort() | resps = groups.all_members(configuration.groups.resp_prefix + name) | def user_line(login): uid = users.login_to_uid(login) return '''<tr><td>%s</td><td>%s</td><td>%s</td></tr>''' % ( u[uid]['gecos'], login, uid) | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py |
<h2>%s</h2><div style="text-align:center;">%s</div> | <h2>%s</h2> <div style="text-align:left;">%s</div> | def user_line(login): uid = users.login_to_uid(login) return '''<tr><td>%s</td><td>%s</td><td>%s</td></tr>''' % ( u[uid]['gecos'], login, uid) | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py |
''' % (_('Responsibles'), _('(ordered by login)'), _('Full Name'), _('Identifier'), _('UID'), "\n".join(map(user_line, resps))) | ''' % ( _('Responsibles'), _('(ordered by login)'), _('Full Name'), _('Identifier'), _('UID'), "\n".join(map(user_line, resps)) ) | def user_line(login): uid = users.login_to_uid(login) return '''<tr><td>%s</td><td>%s</td><td>%s</td></tr>''' % ( u[uid]['gecos'], login, uid) | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py |
<h2>%s</h2><div style="text-align:center;">%s</div> | <h2>%s</h2> <div style="text-align:left;">%s</div> | def user_line(login): uid = users.login_to_uid(login) return '''<tr><td>%s</td><td>%s</td><td>%s</td></tr>''' % ( u[uid]['gecos'], login, uid) | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py |
''' % (_('Guests'), _('(ordered by login)'), _('Full Name'), _('Identifier'), _('UID'), "\n".join(map(user_line, guests))) else: guests_html = "<h2>%s</h2>" % _('No guests for this group.') | ''' % ( _('Guests'), _('(ordered by login)'), _('Full Name'), _('Identifier'), _('UID'), "\n".join(map(user_line, guests)) ) else: guests_html = "<h2>%s</h2>" % _('No guests in this group.') | def user_line(login): uid = users.login_to_uid(login) return '''<tr><td>%s</td><td>%s</td><td>%s</td></tr>''' % ( u[uid]['gecos'], login, uid) | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py |
<div id="content"> | <div id="details"> | def user_line(login): uid = users.login_to_uid(login) return '''<tr><td>%s</td><td>%s</td><td>%s</td></tr>''' % ( u[uid]['gecos'], login, uid) | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py |
_('GID'), _('immutable'), group['gid'], _('Name'), _('immutable'), name, members_html, resps_html, guests_html, | _('GID'), _('immutable'), group['gid'], _('Name'), _('immutable'), name, members_html, resps_html, guests_html, | def user_line(login): uid = users.login_to_uid(login) return '''<tr><td>%s</td><td>%s</td><td>%s</td></tr>''' % ( u[uid]['gecos'], login, uid) | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py |
onClick="javascript:window.print(); return false;", accesskey=_('P')) | onClick="javascript:window.print(); return false;", accesskey=_('P')) | def user_line(login): uid = users.login_to_uid(login) return '''<tr><td>%s</td><td>%s</td><td>%s</td></tr>''' % ( u[uid]['gecos'], login, uid) | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py |
if not UsersController.is_system_uid(uid): | if UsersController.is_system_uid(uid): logging.progress("Checking system account %s..." % \ styles.stylize(styles.ST_NAME, user)) if os.path.exists(self.users[uid]['homeDirectory']): home_dir_info = [ { 'path' : self.users[uid]['homeDirectory'], 'user' : user, 'group' : self.groups.groups[ self.use... | def check_user(user, minimal = minimal, batch = batch, auto_answer = auto_answer): | c1402cdb75c740c515f02436db8af8480233b421 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/c1402cdb75c740c515f02436db8af8480233b421/users.py |
print dir(self.backends) | def SetMissingMandatoryDefauts(self): """ The defaults set here are expected to exist by other parts of the programs. """ | 3930e7f08f68e0a95f2ebab937f10236c8299314 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/3930e7f08f68e0a95f2ebab937f10236c8299314/configuration.py | |
raise exceptions.LicornRuntimeError("Filesystem must be mounted with `acl' option:\n\t%s" % e) | raise exceptions.LicornRuntimeError("Filesystem must be mounted with 'acl' option:\n\t%s" % e) | def CheckBaseDirs(self, minimal = True, batch = False, auto_answer = None) : """Check and eventually repair default needed dirs.""" | 5f520867b3ef14a7fdba756665f78d5a9a2ce3de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5f520867b3ef14a7fdba756665f78d5a9a2ce3de/configuration.py |
dirs_to_verify = [ { 'path' : self.home_backup_dir, 'user' : 'root', 'group' : 'acl', 'access_acl' : "%s,%s,%s" % (acl_base, acl_admins_ro, acl_mask), 'default_acl' : "%s,%s,%s" % (acl_base, acl_admins_ro, acl_mask), 'content_acl' : ("%s,%s,%s" % (acl_base, acl_admins_ro, a... | home_backup_dir_info['content_acl'] = ("%s,%s,%s" % (acl_base, acl_admins_ro, acl_mask) ).replace('r-x', 'r--').replace('rwx', 'rw-') home_archive_dir_info['content_acl'] = ("%s,%s,%s" % (acl_base, acl_admins_rw, acl_mask) ).replace('r-x', 'r--').replace('rwx', 'rw-') dirs_to_verify = [ home_backup_dir_info, home_arc... | def CheckBaseDirs(self, minimal = True, batch = False, auto_answer = None) : """Check and eventually repair default needed dirs.""" | 5f520867b3ef14a7fdba756665f78d5a9a2ce3de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5f520867b3ef14a7fdba756665f78d5a9a2ce3de/configuration.py |
_("Definitely remove account from the LMC.system.")) | _("Definitely remove account from the system.")) | def html_build_compact(index, accounts = accounts): uid = ordered[index] login = u[uid]['login'] edit = (_('''<em>Click to edit current user account parameters:</em> <br /> UID: <strong>%d</strong><br /> GID: %d (primary group <strong>%s</strong>)<br /><br /> Groups: <strong>%s</strong><br /><br /> Privileges:&... | e97f363143e453c04ea24ae1f95dda2b53bdd037 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/e97f363143e453c04ea24ae1f95dda2b53bdd037/users.py |
'(objectClass=o)') | '(objectClass=organization)') | def last_init_check(self): """ do a quick LDAP content check, to validate everything is valid. """ | 22534bce6c23ef61f6a54317db57e0068cfa1fb3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/22534bce6c23ef61f6a54317db57e0068cfa1fb3/ldap_backend.py |
onClick = 'onClick="javascript: return(false);"' | onClick = 'onClick="javascript: return(false);"' | def ctxtnav(active = True): if active: disabled = ''; onClick = ''; else: disabled = 'un-clickable'; onClick = 'onClick="javascript: return(false);"' return ''' <div id="ctxtnav" class="nav"> <h2>Context Navigation</h2> <ul> <li><a href="/users/new" title="%s" %s class="%s"><div class="ctxt-icon %s" id="icon-add">%s... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
w.backto(), w.metanav(http_user), w.menu(uri), ctxtnav(), title) | w.backto(), w.metanav(http_user), w.menu(uri), ctxtnav(), title) | def export(uri, http_user, type = "", yes = None): """ Export user accounts list.""" # TODO: reload(profiles) groups.reload() users.reload() del yes title = _("Export user accounts list") data = '<div id="banner">\n%s\n%s</div>\n%s\n<div id="main">\n%s\n<div id="content"><h1>%s</h1>' % ( w.backto(), w.metanav(http_... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
def export(uri, http_user, type = "", yes = None): """ Export user accounts list.""" # TODO: reload(profiles) groups.reload() users.reload() del yes title = _("Export user accounts list") data = '<div id="banner">\n%s\n%s</div>\n%s\n<div id="main">\n%s\n<div id="content"><h1>%s</h1>' % ( w.backto(), w.metanav(http_... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def export(uri, http_user, type = "", yes = None): """ Export user accounts list.""" # TODO: reload(profiles) groups.reload() users.reload() del yes title = _("Export user accounts list") data = '<div id="banner">\n%s\n%s</div>\n%s\n<div id="main">\n%s\n<div id="content"><h1>%s</h1>' % ( w.backto(), w.metanav(http_... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
if type == "CSV": | if type == "CSV": | def export(uri, http_user, type = "", yes = None): """ Export user accounts list.""" # TODO: reload(profiles) groups.reload() users.reload() del yes title = _("Export user accounts list") data = '<div id="banner">\n%s\n%s</div>\n%s\n<div id="main">\n%s\n<div id="content"><h1>%s</h1>' % ( w.backto(), w.metanav(http_... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
def delete(uri, http_user, login, sure = False, no_archive = False, yes = None): """remove user account.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes title = _("Remove user account %s") % login data = w.page_body_start(uri, http_user, ctxtnav, title) if not sure: data +=... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
it to operate an eventual recover.<br />However, you can decide to permanently | it to operate an eventual recover.<br />However, you can decide to permanently | def delete(uri, http_user, login, sure = False, no_archive = False, yes = None): """remove user account.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes title = _("Remove user account %s") % login data = w.page_body_start(uri, http_user, ctxtnav, title) if not sure: data +=... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
form_options = w.checkbox("no_archive", "True", | form_options = w.checkbox("no_archive", "True", | def delete(uri, http_user, login, sure = False, no_archive = False, yes = None): """remove user account.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes title = _("Remove user account %s") % login data = w.page_body_start(uri, http_user, ctxtnav, title) if not sure: data +=... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
def delete(uri, http_user, login, sure = False, no_archive = False, yes = None): """remove user account.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes title = _("Remove user account %s") % login data = w.page_body_start(uri, http_user, ctxtnav, title) if not sure: data +=... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def delete(uri, http_user, login, sure = False, no_archive = False, yes = None): """remove user account.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes title = _("Remove user account %s") % login data = w.page_body_start(uri, http_user, ctxtnav, title) if not sure: data +=... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
return w.page(title, data + | return w.page(title, data + | def unlock(uri, http_user, login): """unlock a user account password.""" title = _("Unlock account %s") % login data = w.page_body_start(uri, http_user, ctxtnav, title) users.reload() data += w.page_body_end() if users.is_system_login(login): return w.page(title, w.error(_("Failed to unlock account"), [ _("alter s... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
def lock(uri, http_user, login, sure = False, remove_remotessh = False, yes = None): """lock a user account password.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes groups.reload() users.reload() title = _("Lock account %s") % login data = w.page_body_start(uri, http_user,... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
if login in groups.all_members('remotessh'): description += _("""<br /><br /> But this will not block incoming %s network connections, if the user uses %s %s or %s public/private keys. To block ANY access to the system, <strong>remove him/her from remotessh group</strong>.""") % (w.acr('SSH'), w.acr('SSH'), w.acr('RS... | if configuration.ssh.enabled : if login in groups.all_members(configuration.ssh.group): description += _("""<br /><br /> But this will not block incoming %s network connections, if the user uses %s %s or %s public/private keys. To block ANY access to the system, <strong>remove him/her from %s group</strong>.""") % (w... | def lock(uri, http_user, login, sure = False, remove_remotessh = False, yes = None): """lock a user account password.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes groups.reload() users.reload() title = _("Lock account %s") % login data = w.page_body_start(uri, http_user,... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
def lock(uri, http_user, login, sure = False, remove_remotessh = False, yes = None): """lock a user account password.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes groups.reload() users.reload() title = _("Lock account %s") % login data = w.page_body_start(uri, http_user,... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
if remove_remotessh: command.extend(['--del-groups', 'remotessh']) | if configuration.ssh.enabled and remove_remotessh: command.extend(['--del-groups', configuration.ssh.group]) | def lock(uri, http_user, login, sure = False, remove_remotessh = False, yes = None): """lock a user account password.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes groups.reload() users.reload() title = _("Lock account %s") % login data = w.page_body_start(uri, http_user,... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
def skel(uri, http_user, login, sure = False, apply_skel = configuration.users.default_skel, yes = None): """reapply a user's skel with confirmation.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes # TODO: profiles.reload() groups.reload() users.reload() u = users.users g = ... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def skel(uri, http_user, login, sure = False, apply_skel = configuration.users.default_skel, yes = None): """reapply a user's skel with confirmation.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes # TODO: profiles.reload() groups.reload() users.reload() u = users.users g = ... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def skel(uri, http_user, login, sure = False, apply_skel = configuration.users.default_skel, yes = None): """reapply a user's skel with confirmation.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes # TODO: profiles.reload() groups.reload() users.reload() u = users.users g = ... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def skel(uri, http_user, login, sure = False, apply_skel = configuration.users.default_skel, yes = None): """reapply a user's skel with confirmation.""" # forget about it, this is a scoria from the POST FORM to variable conversion. del yes # TODO: profiles.reload() groups.reload() users.reload() u = users.users g = ... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def filter_skels(pri_group, sk_list): ''' TODO: to be converted to licorn model if pri_group == configuration.mNames['RESPONSABLES_GROUP']: return filter(lambda x: x.rfind("/%s/" % configuration.mNames['RESPONSABLES_GROUP']) != -1, sk_list) elif pri_group == configuration.mNames['USAGERS_GROUP']: return filter(lambda x... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def filter_skels(pri_group, sk_list): ''' TODO: to be converted to licorn model if pri_group == configuration.mNames['RESPONSABLES_GROUP']: return filter(lambda x: x.rfind("/%s/" % configuration.mNames['RESPONSABLES_GROUP']) != -1, sk_list) elif pri_group == configuration.mNames['USAGERS_GROUP']: return filter(lambda x... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def new(uri, http_user): """Generate a form to create a new user on the system.""" # TODO: profiles.reload() groups.reload() g = groups.groups p = profiles.profiles title = _("New user account") data = w.page_body_start(uri, http_user, ctxtnav, title, False) def profile_input(): #TODO: To be rewritten ? return ""... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def new(uri, http_user): """Generate a form to create a new user on the system.""" # TODO: profiles.reload() groups.reload() g = groups.groups p = profiles.profiles title = _("New user account") data = w.page_body_start(uri, http_user, ctxtnav, title, False) def profile_input(): #TODO: To be rewritten ? return ""... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def create(uri, http_user, loginShell, password, password_confirm, profile = None, login = "", gecos = "", firstname = "", lastname = "", standard_groups_dest = [], privileged_groups_dest = [], responsible_groups_dest = [], guest_groups_dest = [], standard_groups_source = [], privileged_groups_source = [], responsible_... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def create(uri, http_user, loginShell, password, password_confirm, profile = None, login = "", gecos = "", firstname = "", lastname = "", standard_groups_dest = [], privileged_groups_dest = [], responsible_groups_dest = [], guest_groups_dest = [], standard_groups_source = [], privileged_groups_source = [], responsible_... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def create(uri, http_user, loginShell, password, password_confirm, profile = None, login = "", gecos = "", firstname = "", lastname = "", standard_groups_dest = [], privileged_groups_dest = [], responsible_groups_dest = [], guest_groups_dest = [], standard_groups_source = [], privileged_groups_source = [], responsible_... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def create(uri, http_user, loginShell, password, password_confirm, profile = None, login = "", gecos = "", firstname = "", lastname = "", standard_groups_dest = [], privileged_groups_dest = [], responsible_groups_dest = [], guest_groups_dest = [], standard_groups_source = [], privileged_groups_source = [], responsible_... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def create(uri, http_user, loginShell, password, password_confirm, profile = None, login = "", gecos = "", firstname = "", lastname = "", standard_groups_dest = [], privileged_groups_dest = [], responsible_groups_dest = [], guest_groups_dest = [], standard_groups_source = [], privileged_groups_source = [], responsible_... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
return w.page(title, | return w.page(title, | def create(uri, http_user, loginShell, password, password_confirm, profile = None, login = "", gecos = "", firstname = "", lastname = "", standard_groups_dest = [], privileged_groups_dest = [], responsible_groups_dest = [], guest_groups_dest = [], standard_groups_source = [], privileged_groups_source = [], responsible_... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
title = _('Edit account %s') % login | title = _('Edit account %s') % login | def edit(uri, http_user, login): """Edit an user account, based on login.""" groups.reload() users.reload() # TODO: profiles.reload() title = _('Edit account %s') % login data = w.page_body_start(uri, http_user, ctxtnav, title, False) if users.is_system_login(login): return w.minipage(title, w.error(_('Account edit... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
def edit(uri, http_user, login): """Edit an user account, based on login.""" groups.reload() users.reload() # TODO: profiles.reload() title = _('Edit account %s') % login data = w.page_body_start(uri, http_user, ctxtnav, title, False) if users.is_system_login(login): return w.minipage(title, w.error(_('Account edit... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def edit(uri, http_user, login): """Edit an user account, based on login.""" groups.reload() users.reload() # TODO: profiles.reload() title = _('Edit account %s') % login data = w.page_body_start(uri, http_user, ctxtnav, title, False) if users.is_system_login(login): return w.minipage(title, w.error(_('Account edit... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def record(uri, http_user, login, loginShell = configuration.users.default_shell, password = "", password_confirm = "", firstname = "", lastname = "", gecos = "", standard_groups_source = [], standard_groups_dest = [], privileged_groups_source = [], privileged_groups_dest = [], responsible_groups_source = [], r... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def main(uri, http_user, sort = "login", order = "asc"): start = time.time() groups.reload() users.reload() # TODO: profiles.reload() u = users.users g = groups.groups p = profiles.profiles groups.Select(groups.FILTER_PRIVILEGED) pri_grps = [ g[gid]['name'] for gid in groups.filtered_groups ] groups.Select(groups.... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def main(uri, http_user, sort = "login", order = "asc"): start = time.time() groups.reload() users.reload() # TODO: profiles.reload() u = users.users g = groups.groups p = profiles.profiles groups.Select(groups.FILTER_PRIVILEGED) pri_grps = [ g[gid]['name'] for gid in groups.filtered_groups ] groups.Select(groups.... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
login, edit, login, | login, edit, login, | def html_build_compact(index, accounts = accounts): uid = ordered[index] login = u[uid]['login'] edit = (_("""<em>Click to edit current user account parameters:</em><br /> UID: <strong>%d</strong><br /> GID: %d (primary group <strong>%s</strong>)<br /><br /> Groups: <strong>%s</strong><br /><br /> Privileges:&#... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
when user has lost icons, or modified too much his/her desktop (menus, panels and so on). | when user has lost icons, or modified too much his/her desktop (menus, panels and so on). | def html_build_compact(index, accounts = accounts): uid = ordered[index] login = u[uid]['login'] edit = (_("""<em>Click to edit current user account parameters:</em><br /> UID: <strong>%d</strong><br /> GID: %d (primary group <strong>%s</strong>)<br /><br /> Groups: <strong>%s</strong><br /><br /> Privileges:&#... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
def html_build_compact(index, accounts = accounts): uid = ordered[index] login = u[uid]['login'] edit = (_("""<em>Click to edit current user account parameters:</em><br /> UID: <strong>%d</strong><br /> GID: %d (primary group <strong>%s</strong>)<br /><br /> Groups: <strong>%s</strong><br /><br /> Privileges:&#... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
login = user['login'] | login = user['login'] | def html_build_compact(index, accounts = accounts): uid = ordered[index] login = u[uid]['login'] edit = (_("""<em>Click to edit current user account parameters:</em><br /> UID: <strong>%d</strong><br /> GID: %d (primary group <strong>%s</strong>)<br /><br /> Groups: <strong>%s</strong><br /><br /> Privileges:&#... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
def html_build_compact(index, accounts = accounts): uid = ordered[index] login = u[uid]['login'] edit = (_("""<em>Click to edit current user account parameters:</em><br /> UID: <strong>%d</strong><br /> GID: %d (primary group <strong>%s</strong>)<br /><br /> Groups: <strong>%s</strong><br /><br /> Privileges:&#... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
def html_build_compact(index, accounts = accounts): uid = ordered[index] login = u[uid]['login'] edit = (_("""<em>Click to edit current user account parameters:</em><br /> UID: <strong>%d</strong><br /> GID: %d (primary group <strong>%s</strong>)<br /><br /> Groups: <strong>%s</strong><br /><br /> Privileges:&#... | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py | ||
''' % (print_totals(totals), _("<strong>Total number of accounts:</strong>"), | ''' % (print_totals(totals), _("<strong>Total number of accounts:</strong>"), | def print_totals(totals): output = "" for total in totals: if totals[total] != 0: output += ''' | 1ac7de7fa0474fe0812c899f93a87f4be2a8eadb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1ac7de7fa0474fe0812c899f93a87f4be2a8eadb/users.py |
'''command "%s" failed (retcode %d instead of %d).\n''' | '''command "%s" failed (retcode %s instead of %s).\n''' | def RunAndCheck(self, cmd, batch = False, inverse_test=False): ref_output, ref_code = self.PrepareReferenceOutput(cmd) | 11c2b6b6f98781896ba8bed27998ea4bdd46dd93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/11c2b6b6f98781896ba8bed27998ea4bdd46dd93/core.py |
ProfilesController.configuration.users.base_path, | def ExportCLI(self): """ Export the user profiles list to human readable form. """ data = "" | 05b33e0a707a748843b535af7ccbcba280a9447c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/05b33e0a707a748843b535af7ccbcba280a9447c/profiles.py | |
and gid > LMC.configuration.groups.gid_max | or gid > LMC.configuration.groups.gid_max | def is_restricted_system_gid(self, gid): """ Return true if gid is system, but outside the range of Licorn® controlled GIDs.""" return gid < LMC.configuration.groups.system_gid_min \ and gid > LMC.configuration.groups.gid_max | 7eec532cdc560cadf103bebae014cc1914d2cc08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/7eec532cdc560cadf103bebae014cc1914d2cc08/groups.py |
command = [ "sudo", "mod", "user", "--quiet", "--no-colors", "--login", login, '--apply-skel', skel ] | command = [ "sudo", "mod", "user", "--quiet", "--no-colors", "--login", login, '--apply-skel', apply_skel ] | def filter_skels(pri_group, sk_list): ''' TODO: to be converted to licorn model if pri_group == configuration.mNames['RESPONSABLES_GROUP']: return filter(lambda x: x.rfind("/%s/" % configuration.mNames['RESPONSABLES_GROUP']) != -1, sk_list) elif pri_group == configuration.mNames['USAGERS_GROUP']: return filter(lambda x... | b1c965e2c6d0e0f8c814177d2f5c4d4dc29a16c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b1c965e2c6d0e0f8c814177d2f5c4d4dc29a16c2/users.py |
return styles.stylize(styles.ST_NAME, ' '.join(cmd)) | return stylize(ST_NAME, ' '.join(cmd)) | def cmdfmt(cmd): '''convert a sequence to a colorized string.''' return styles.stylize(styles.ST_NAME, ' '.join(cmd)) | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
% (styles.colors[styles.ST_LOG], msg, styles.colors[styles.ST_NO]) ) | % (colors[ST_LOG], msg, colors[ST_NO]) ) | def test_message(msg): """ display a message to stderr. """ sys.stderr.write("%s>>> %s%s\n" % (styles.colors[styles.ST_LOG], msg, styles.colors[styles.ST_NO]) ) | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
sys.stderr.write("%s>>> running %s%s%s\n" % (styles.colors[styles.ST_LOG], styles.colors[styles.ST_PATH], command, styles.colors[styles.ST_NO])) | sys.stderr.write("%s>>> running %s%s%s\n" % (colors[ST_LOG], colors[ST_PATH], command, colors[ST_NO])) | def log_and_exec (command, inverse_test=False, result_code=0, comment="", verb=verbose): """Display a command, execute it, and exit if soemthing went wrong.""" #if not command.startswith('colordiff'): # command += ' %s' % ' '.join(args) sys.stderr.write("%s>>> running %s%s%s\n" % (styles.colors[styles.ST_LOG], styles... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
% (styles.colors[styles.ST_PATH], styles.colors[styles.ST_BAD], comment, styles.colors[styles.ST_NO])) | % (colors[ST_PATH], colors[ST_BAD], comment, colors[ST_NO])) | def log_and_exec (command, inverse_test=False, result_code=0, comment="", verb=verbose): """Display a command, execute it, and exit if soemthing went wrong.""" #if not command.startswith('colordiff'): # command += ' %s' % ' '.join(args) sys.stderr.write("%s>>> running %s%s%s\n" % (styles.colors[styles.ST_LOG], styles... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
% ( styles.colors[styles.ST_LOG], styles.colors[styles.ST_BAD], retcode, styles.colors[styles.ST_LOG], result_code, styles.colors[styles.ST_NO], test) ) | % ( colors[ST_LOG], colors[ST_BAD], retcode, colors[ST_LOG], result_code, colors[ST_NO], test) ) | def log_and_exec (command, inverse_test=False, result_code=0, comment="", verb=verbose): """Display a command, execute it, and exit if soemthing went wrong.""" #if not command.startswith('colordiff'): # command += ' %s' % ' '.join(args) sys.stderr.write("%s>>> running %s%s%s\n" % (styles.colors[styles.ST_LOG], styles... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
return re.sub(r'\s\[\d\d\d\d/\d\d/\d\d\s\d\d:\d\d:\d\d\.\d\d\d\d\]\s', | return re.sub(r'(\.\d\d\d\d\d\d\d\d-\d\d\d\d\d\d|\s\[\d\d\d\d/\d\d/\d\d\s\d\d:\d\d:\d\d\.\d\d\d\d\]\s)', | def strip_dates(str): """ strip dates from warnings and traces, else outputs and references always compare false .""" return re.sub(r'\s\[\d\d\d\d/\d\d/\d\d\s\d\d:\d\d:\d\d\.\d\d\d\d\]\s', r' [D/T] ', str) | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
class FunctionnalTest: | def save_state(num, state_type='scenarii'): open(state_files[state_type],'w').write('%d' % num) def get_state(state_type='scenarii'): if os.path.exists(state_files[state_type]): return int(open(state_files[state_type]).read()) else: return 0 class ScenarioTest: | def strip_dates(str): """ strip dates from warnings and traces, else outputs and references always compare false .""" return re.sub(r'\s\[\d\d\d\d/\d\d/\d\d\s\d\d:\d\d:\d\d\.\d\d\d\d\]\s', r' [D/T] ', str) | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
def __init__(self, cmd, pre_cmds=[], chk_cmds=[], manual_output=False, reference_cmd=[], context='std'): if type(cmd) == type(''): self.cmd = cmd.split(' ') else: self.cmd = cmd self.pre_cmds = pre_cmds self.chk_cmds = chk_cmds self.reference_cmd = reference_cmd self.context = context self.manual_outp... | def __init__(self, cmds, context='std', descr=None): self.context = context self.sce_number = ScenarioTest.counter self.cmd_counter = 0 self.name = '%s%s%s%s%s' % ( stylize(ST_NAME, 'Scenario stylize(ST_OK, ScenarioTest.counter), stylize(ST_NAME, ' (%s)' % descr) if descr else '', stylize(ST_NAME, ', context '),... | def __init__(self, cmd, pre_cmds=[], chk_cmds=[], manual_output=False, reference_cmd=[], context='std'): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
os.makedirs(os.path.dirname(self.ref_output_file)) | os.makedirs('%s/%s' % (self.base_path, cmdnum)) | def SaveOutput(self, output, code): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
open(self.ref_output_file, 'w').write(strip_dates(output)) open(self.ref_code_file, 'w').write(str(code)) def PrepareReferenceOutput(self, cmd): if os.path.exists(self.ref_output_file): return (open(self.ref_output_file).read(), int(open(self.ref_code_file).read())) | open('%s/%s/cmdline.txt' % (self.base_path, cmdnum), 'w').write( ' '.join(self.cmds[cmdnum])) open('%s/%s/out.txt' % (self.base_path, cmdnum), 'w').write( strip_dates(output)) open('%s/%s/code.txt' % (self.base_path, cmdnum), 'w').write(str(code)) def RunCommand(self, cmdnum, batch=False): if os.path.exists('%s/%s' % ... | def SaveOutput(self, output, code): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
logging.notice('no reference output for cmd FunctionnalTest.counter, cmdfmt(cmd), 'referer=%s, ' % cmdfmt(self.reference_cmd) \ if self.reference_cmd != [] else '', self.context)) output, retcode = execute(cmd) | logging.notice('''no reference output for %s, cmd ''' creating one…''' % (self.name, stylize(ST_OK, cmdnum), cmdfmt(self.cmds[cmdnum]))) output, retcode = execute(self.cmds[cmdnum]) | def PrepareReferenceOutput(self, cmd): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
if logging.ask_for_repair('is this output good to keep as reference for future runs?'): self.SaveOutput(output, retcode) | if logging.ask_for_repair('''is this output good to keep as ''' '''reference for future runs?'''): self.SaveOutput(cmdnum, output, retcode) | def PrepareReferenceOutput(self, cmd): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
logging.error('you MUST have a reference output; please fix code or rerun this test.') def RunAndCheck(self, cmd, batch = False, inverse_test=False): ref_output, ref_code = self.PrepareReferenceOutput(cmd) output, retcode = execute(cmd) bad_run = False message = '' if retcode != ref_code: logging.warning( '''command... | logging.error('''you MUST have a reference output; please ''' '''fix code or rerun this test.''') def Run(self, options=[], batch=False, inverse_test=False, ): """ run each command of the scenario, in turn. """ start_scenario = get_state() if self.sce_number < start_scenario: logging.notice('Skipping %s' % stylize(S... | def PrepareReferenceOutput(self, cmd): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
test_message('testing integrated help.') for program in (GETENT, ADD, MODIFY, DELETE, CHECK): FunctionnalTest(program).Run(options = [['-h'], ['--help']]) | commands = [] for program in (GET, ADD, MOD, DEL, CHK): commands.extend([ program + ['-h'], program + ['--help']]) | def test_integrated_help (): """Test extensively argmarser contents and intergated help.""" test_message('testing integrated help.') for program in (GETENT, ADD, MODIFY, DELETE, CHECK): FunctionnalTest(program).Run(options = [['-h'], ['--help']]) if program == ADD: modes = [ 'user', 'users', 'group', 'profile' ] el... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
elif program == MODIFY: | elif program == MOD: | def test_integrated_help (): """Test extensively argmarser contents and intergated help.""" test_message('testing integrated help.') for program in (GETENT, ADD, MODIFY, DELETE, CHECK): FunctionnalTest(program).Run(options = [['-h'], ['--help']]) if program == ADD: modes = [ 'user', 'users', 'group', 'profile' ] el... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
elif program == DELETE: | elif program == DEL: | def test_integrated_help (): """Test extensively argmarser contents and intergated help.""" test_message('testing integrated help.') for program in (GETENT, ADD, MODIFY, DELETE, CHECK): FunctionnalTest(program).Run(options = [['-h'], ['--help']]) if program == ADD: modes = [ 'user', 'users', 'group', 'profile' ] el... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
elif program == GETENT: | elif program == GET: | def test_integrated_help (): """Test extensively argmarser contents and intergated help.""" test_message('testing integrated help.') for program in (GETENT, ADD, MODIFY, DELETE, CHECK): FunctionnalTest(program).Run(options = [['-h'], ['--help']]) if program == ADD: modes = [ 'user', 'users', 'group', 'profile' ] el... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
elif program == CHECK: | elif program == CHK: | def test_integrated_help (): """Test extensively argmarser contents and intergated help.""" test_message('testing integrated help.') for program in (GETENT, ADD, MODIFY, DELETE, CHECK): FunctionnalTest(program).Run(options = [['-h'], ['--help']]) if program == ADD: modes = [ 'user', 'users', 'group', 'profile' ] el... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
if program == GETENT and mode == 'configuration': FunctionnalTest(program + [mode]).Run() | if program == GET and mode == 'configuration': commands.append(program + [ mode ]) | def test_integrated_help (): """Test extensively argmarser contents and intergated help.""" test_message('testing integrated help.') for program in (GETENT, ADD, MODIFY, DELETE, CHECK): FunctionnalTest(program).Run(options = [['-h'], ['--help']]) if program == ADD: modes = [ 'user', 'users', 'group', 'profile' ] el... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
FunctionnalTest(program + [mode]).Run(options = [['-h'], ['--help']]) test_message('integrated help testing finished.') | commands.extend([ program + [ mode, '-h'], program + [ mode, '--help'] ]) ScenarioTest(commands, descr="integrated help").Run() | def test_integrated_help (): """Test extensively argmarser contents and intergated help.""" test_message('testing integrated help.') for program in (GETENT, ADD, MODIFY, DELETE, CHECK): FunctionnalTest(program).Run(options = [['-h'], ['--help']]) if program == ADD: modes = [ 'user', 'users', 'group', 'profile' ] el... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
test_message('''starting get tests.''') | commands = [] | def test_get(context): """Test GET a lot.""" test_message('''starting get tests.''') for category in [ 'config_dir', 'main_config_file', 'extendedgroup_data_file' ]: for mode in [ '', '-s', '-b', '--bourne-shell', '-c', '--c-shell', '-p', '--php-code' ]: FunctionnalTest(GETENT + [ 'configuration', category, mode ], c... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
FunctionnalTest(GETENT + [ 'configuration', category, mode ], context=context).Run() | commands.append(GET + [ 'configuration', category, mode ]) | def test_get(context): """Test GET a lot.""" test_message('''starting get tests.''') for category in [ 'config_dir', 'main_config_file', 'extendedgroup_data_file' ]: for mode in [ '', '-s', '-b', '--bourne-shell', '-c', '--c-shell', '-p', '--php-code' ]: FunctionnalTest(GETENT + [ 'configuration', category, mode ], c... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
FunctionnalTest(GETENT + [ 'config', category ], context=context).Run() commands = ( | commands.append(GET + [ 'config', category ]) commands += [ | def test_get(context): """Test GET a lot.""" test_message('''starting get tests.''') for category in [ 'config_dir', 'main_config_file', 'extendedgroup_data_file' ]: for mode in [ '', '-s', '-b', '--bourne-shell', '-c', '--c-shell', '-p', '--php-code' ]: FunctionnalTest(GETENT + [ 'configuration', category, mode ], c... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
GETENT + [ "users" ], GETENT + [ "users", "--xml" ], GETENT + [ "users", "--long" ], GETENT + [ "users", "--long", "--xml" ], GETENT + [ "users", "--all" ], GETENT + [ "users", "--xml", "--all" ], GETENT + [ "users", "--all", "--long" ], GETENT + [ "users", "--xml", "--all", "--long" ], | GET + [ "users" ], GET + [ "users", "--xml" ], GET + [ "users", "--long" ], GET + [ "users", "--long", "--xml" ], GET + [ "users", "--all" ], GET + [ "users", "--xml", "--all" ], GET + [ "users", "--all", "--long" ], GET + [ "users", "--xml", "--all", "--long" ], | def test_get(context): """Test GET a lot.""" test_message('''starting get tests.''') for category in [ 'config_dir', 'main_config_file', 'extendedgroup_data_file' ]: for mode in [ '', '-s', '-b', '--bourne-shell', '-c', '--c-shell', '-p', '--php-code' ]: FunctionnalTest(GETENT + [ 'configuration', category, mode ], c... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
GETENT + [ "groups" ], GETENT + [ "groups", "--xml" ], GETENT + [ "groups", "--long" ], GETENT + [ "groups", "--long", "--xml" ], GETENT + [ "groups", "--xml", "--all" ], GETENT + [ "groups", "--xml", "--all", "--long" ], GETENT + [ "groups", "--xml", "--guests" ], GETENT + [ "groups", "--xml", "--guests", "--long " ],... | GET + [ "groups" ], GET + [ "groups", "--xml" ], GET + [ "groups", "--long" ], GET + [ "groups", "--long", "--xml" ], GET + [ "groups", "--xml", "--all" ], GET + [ "groups", "--xml", "--all", "--long" ], GET + [ "groups", "--xml", "--guests" ], GET + [ "groups", "--xml", "--guests", "--long" ], GET + [ "groups", "--xml... | def test_get(context): """Test GET a lot.""" test_message('''starting get tests.''') for category in [ 'config_dir', 'main_config_file', 'extendedgroup_data_file' ]: for mode in [ '', '-s', '-b', '--bourne-shell', '-c', '--c-shell', '-p', '--php-code' ]: FunctionnalTest(GETENT + [ 'configuration', category, mode ], c... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
GETENT + [ "profiles" ], GETENT + [ "profiles", "--xml" ], ) for command in commands: FunctionnalTest(command, context=context) test_message('''`get` tests finished.''') | GET + [ "profiles" ], GET + [ "profiles", "--xml" ], ] ScenarioTest(commands, context=context, descr="get tests").Run() | def test_get(context): """Test GET a lot.""" test_message('''starting get tests.''') for category in [ 'config_dir', 'main_config_file', 'extendedgroup_data_file' ]: for mode in [ '', '-s', '-b', '--bourne-shell', '-c', '--c-shell', '-p', '--php-code' ]: FunctionnalTest(GETENT + [ 'configuration', category, mode ], c... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
ADD + [ 'group', "--name='_- -_'"], CHECK + [ 'group', "--name='_- -_'"], ADD + [ 'group', "--name=';-)'"], ADD + [ 'group', "--name='^_^'"], ADD + [ 'group', "--name='le copain des groupes'"], CHECK + [ 'group', '-v', "--name='le copain des groupes'"], ADD + [ 'group', "--name='héhéhé'"], ADD + [ 'group'... | ADD + [ 'group', "--name='_- -_'"], CHK + [ 'group', "--name='_- -_'"], ADD + [ 'group', "--name=';-)'"], ADD + [ 'group', "--name='^_^'"], ADD + [ 'group', "--name='le copain des groupes'"], CHK + [ 'group', '-v', "--name='le copain des groupes'"], ADD + [ 'group', "--name='héhéhé'"], ADD + [ 'group', "--name='%(\`l... | def test_regexes(): """ Try funky strings to make regexes fail (they should not).""" # TODO: test regexes directly from defs in licorn.core.... test_message('''starting regexes tests.''') regexes_commands = [] # groups related regexes_commands.extend([ ADD + [ 'group', "--name='_- -_'"], CHECK + [ 'group', "--nam... | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.