rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def skel(uri, 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 = groups.gr...
8d0ea9eae6c1be319b21e5a49e5074e6478f580d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/8d0ea9eae6c1be319b21e5a49e5074e6478f580d/users.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(lambd...
8d0ea9eae6c1be319b21e5a49e5074e6478f580d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/8d0ea9eae6c1be319b21e5a49e5074e6478f580d/users.py
profile.add_option("--group", "--name",
profile.add_option("--name", action="store", type="string", dest="name", default = None, help="specify profile to modify by its name (%s)." % styles.stylize(styles.ST_IMPORTANT, "one of --name or --group is required")) profile.add_option("--group",
def mod_profile_parse_arguments(app): usage_text = "\n\t%s profile --group=<nom> [--name=<nouveau_nom>] [--rename-group=<nouveau_nom>]\n" % styles.stylize(styles.ST_APPNAME, "%prog") \ + "\t\t[--comment=<nouveau_commentaire>] [--shell=<nouveau_shell>] [--skel=<nouveau_skel>]\n" \ + "\t\t[--quota=<nouveau_quota>] [--ad...
4559cb68c55d791cc4138a382ba8a46485ca1efd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/4559cb68c55d791cc4138a382ba8a46485ca1efd/argparser.py
help="specify profile to modify by its primary group (%s)." % styles.stylize(styles.ST_IMPORTANT, "required"))
help="specify profile to modify by its primary group (%s)." % styles.stylize(styles.ST_IMPORTANT, "one of --name or --group is required"))
def mod_profile_parse_arguments(app): usage_text = "\n\t%s profile --group=<nom> [--name=<nouveau_nom>] [--rename-group=<nouveau_nom>]\n" % styles.stylize(styles.ST_APPNAME, "%prog") \ + "\t\t[--comment=<nouveau_commentaire>] [--shell=<nouveau_shell>] [--skel=<nouveau_skel>]\n" \ + "\t\t[--quota=<nouveau_quota>] [--ad...
4559cb68c55d791cc4138a382ba8a46485ca1efd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/4559cb68c55d791cc4138a382ba8a46485ca1efd/argparser.py
if user['shadowExpire'] == '':
if 'shadowExpire' in user and user['shadowExpire'] == '':
def save_User(self, uid, mode): """ Save one user in the LDAP backend. If updating, the entry will be dropped prior of insertion. """
1bcb0e3fee84acbc717132da1506e7084ebf8f9a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1bcb0e3fee84acbc717132da1506e7084ebf8f9a/openldap.py
if user['shadowFlag'] == '':
if 'shadowFlag' in user and user['shadowFlag'] == '':
def save_User(self, uid, mode): """ Save one user in the LDAP backend. If updating, the entry will be dropped prior of insertion. """
1bcb0e3fee84acbc717132da1506e7084ebf8f9a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1bcb0e3fee84acbc717132da1506e7084ebf8f9a/openldap.py
if user['shadowInactive'] == '':
if 'shadowInactive' in user and user['shadowInactive'] == '':
def save_User(self, uid, mode): """ Save one user in the LDAP backend. If updating, the entry will be dropped prior of insertion. """
1bcb0e3fee84acbc717132da1506e7084ebf8f9a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/1bcb0e3fee84acbc717132da1506e7084ebf8f9a/openldap.py
groups = GroupsController(self.configuration)
users = UsersController(self.configuration) groups = GroupsController(self.configuration, users)
def append(self, privilege): """ Set append like: no doubles.""" try: self.index(privilege) except ValueError: from licorn.core.groups import GroupsController groups = GroupsController(self.configuration) if groups.is_system_group(privilege): list.append(self, privilege) else: logging.warning("%s is not a privilege." %...
5e51e61aa801bd2b33915b561a0ea0c4b159a6c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5e51e61aa801bd2b33915b561a0ea0c4b159a6c4/privileges.py
return (w.HTTP_TYPE_TEXT, w.minipage(w.lbox('''%s <div class="vspacer"></div>
return (w.HTTP_TYPE_TEXT, w.minipage(w.lbox(''' <div style="line-height: 1.5em; padding-bottom:20px">%s</div>
def reboot(uri, http_user, sure = False): if sure: return (w.HTTP_TYPE_TEXT, w.minipage(w.lbox('''<div class="vspacer"></div>%s''' % \ _('Rebooting…')))) else: return (w.HTTP_TYPE_TEXT, w.minipage(w.lbox('''%s <div class="vspacer"></div> <table class="lbox-table"> <tr> <td> <form name="reboot_form" id="reboot_form" act...
006632e8b9a15157ad0ccff9a95da1fbb4ae85c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/006632e8b9a15157ad0ccff9a95da1fbb4ae85c2/server.py
from licorn.core import groups as allgroups if allusers is None: from licorn.core import users as allusers
from licorn.core.groups import GroupsController allgroups = GroupsController(allusers.configuration, allusers)
def check_dirs_and_contents_perms_and_acls(dirs_infos, batch = False, auto_answer = None, allgroups = None, allusers = None): """ Check if a dir exists, else create it and apply ACLs on it eventually. dirs_infos should be a n-tuple of dicts, composed like this: { 'path' : string, 'type' : stat.S_IF???, ...
09be11c609797e29cd65819ebd1b1b664074d86b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/09be11c609797e29cd65819ebd1b1b664074d86b/fsapi.py
from licorn.core import groups as allgroups if allusers is None: from licorn.core import users as allusers
from licorn.core.groups import GroupsController allgroups = GroupsController(allusers.configuration, allusers)
def check_posix_ugid_and_perms(onpath, uid = -1, gid = -1, perms = -1, batch = False, auto_answer = None, allgroups = None, allusers = None): """Check if some path has some desired perms, repair if told to do so.""" if onpath in ("", None): raise exceptions.BadArgumentError("The path you want to check perms on must no...
09be11c609797e29cd65819ebd1b1b664074d86b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/09be11c609797e29cd65819ebd1b1b664074d86b/fsapi.py
desired_login = allusers.users[ uid ]['login']
desired_login = allusers[uid]['login']
def check_posix_ugid_and_perms(onpath, uid = -1, gid = -1, perms = -1, batch = False, auto_answer = None, allgroups = None, allusers = None): """Check if some path has some desired perms, repair if told to do so.""" if onpath in ("", None): raise exceptions.BadArgumentError("The path you want to check perms on must no...
09be11c609797e29cd65819ebd1b1b664074d86b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/09be11c609797e29cd65819ebd1b1b664074d86b/fsapi.py
desired_login = allusers.users[ uid ]['login']
desired_login = allusers[uid]['login']
def check_posix_ugid_and_perms(onpath, uid = -1, gid = -1, perms = -1, batch = False, auto_answer = None, allgroups = None, allusers = None): """Check if some path has some desired perms, repair if told to do so.""" if onpath in ("", None): raise exceptions.BadArgumentError("The path you want to check perms on must no...
09be11c609797e29cd65819ebd1b1b664074d86b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/09be11c609797e29cd65819ebd1b1b664074d86b/fsapi.py
desired_group = allgroups.groups[ gid ]['name']
desired_group = allgroups[gid]['name']
def check_posix_ugid_and_perms(onpath, uid = -1, gid = -1, perms = -1, batch = False, auto_answer = None, allgroups = None, allusers = None): """Check if some path has some desired perms, repair if told to do so.""" if onpath in ("", None): raise exceptions.BadArgumentError("The path you want to check perms on must no...
09be11c609797e29cd65819ebd1b1b664074d86b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/09be11c609797e29cd65819ebd1b1b664074d86b/fsapi.py
desired_group = allgroups.groups[ gid ]['name']
desired_group = allgroups[gid]['name']
def check_posix_ugid_and_perms(onpath, uid = -1, gid = -1, perms = -1, batch = False, auto_answer = None, allgroups = None, allusers = None): """Check if some path has some desired perms, repair if told to do so.""" if onpath in ("", None): raise exceptions.BadArgumentError("The path you want to check perms on must no...
09be11c609797e29cd65819ebd1b1b664074d86b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/09be11c609797e29cd65819ebd1b1b664074d86b/fsapi.py
current_login = allusers.users[ pathstat.st_uid ]['login']
current_login = allusers[pathstat.st_uid]['login']
def check_posix_ugid_and_perms(onpath, uid = -1, gid = -1, perms = -1, batch = False, auto_answer = None, allgroups = None, allusers = None): """Check if some path has some desired perms, repair if told to do so.""" if onpath in ("", None): raise exceptions.BadArgumentError("The path you want to check perms on must no...
09be11c609797e29cd65819ebd1b1b664074d86b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/09be11c609797e29cd65819ebd1b1b664074d86b/fsapi.py
current_group = allgroups.groups[ pathstat.st_gid ]['name']
current_group = allgroups[pathstat.st_gid]['name']
def check_posix_ugid_and_perms(onpath, uid = -1, gid = -1, perms = -1, batch = False, auto_answer = None, allgroups = None, allusers = None): """Check if some path has some desired perms, repair if told to do so.""" if onpath in ("", None): raise exceptions.BadArgumentError("The path you want to check perms on must no...
09be11c609797e29cd65819ebd1b1b664074d86b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/09be11c609797e29cd65819ebd1b1b664074d86b/fsapi.py
to_remove.append(member)
to_remove.add(member)
def load_groups(self): """ Load groups from /etc/{group,gshadow} and /etc/licorn/group. """
353f19b3b5ec055d3d58174646dc5e75a96491cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/353f19b3b5ec055d3d58174646dc5e75a96491cb/unix_backend.py
except (OSError, IOerror), e:
except (OSError, IOError), e:
def CleanUp(self): """This is a sort of destructor. Clean-up before being deleted..."""
31a1d5a2c76235131c71593a3c9219a20464cd4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/31a1d5a2c76235131c71593a3c9219a20464cd4b/configuration.py
def AddGroup(self, name, gid=None, description="", groupSkel="", system=False, permissive=False, batch=False, force=False):
def AddGroup(self, name, gid=None, description="", groupSkel="", system=False, permissive=False, batch=False, force=False):
def AddGroup(self, name, gid=None, description="", groupSkel="", system=False, permissive=False, batch=False, force=False): """ Add an Licorn group (the group + the responsible group + the shared dir + permissions). """
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
self.CheckGroups([ name ], minimal = True, batch = True)
self.CheckGroups([ name ], minimal=True, batch=True)
def AddGroup(self, name, gid=None, description="", groupSkel="", system=False, permissive=False, batch=False, force=False): """ Add an Licorn group (the group + the responsible group + the shared dir + permissions). """
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
logging.info(logging.SYSG_CREATED_GROUP % styles.stylize(styles.ST_NAME, name))
logging.info(logging.SYSG_CREATED_GROUP % \ styles.stylize(styles.ST_NAME, name))
def AddGroup(self, name, gid=None, description="", groupSkel="", system=False, permissive=False, batch=False, force=False): """ Add an Licorn group (the group + the responsible group + the shared dir + permissions). """
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
self.CheckGroupSymlinks(gid = gid, group = name, delete = True, batch = True)
self.CheckGroupSymlinks(gid = gid, group = name, delete=True, batch=True)
def DeleteGroup(self, name, del_users, no_archive, bygid = None, batch=False): """ Delete an Licorn group """ if name is None and bygid is None: raise exceptions.BadArgumentError, "You must specify a name or a GID."
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
self.CheckGroups( [ new_name ], batch = True)
self.CheckGroups( [ new_name ], batch=True)
def RenameGroup(self, profilelist, name, new_name): """ Modify the name of a group."""
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
self.CheckGroupSymlinks(gid, oldname = name, batch = True)
self.CheckGroupSymlinks(gid, oldname=name, batch=True)
def RenameGroup(self, profilelist, name, new_name): """ Modify the name of a group."""
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
all_went_ok &= self.CheckGroupSymlinks(prefix_gid, strip_prefix = prefix, batch = batch, auto_answer = auto_answer)
all_went_ok &= self.CheckGroupSymlinks(prefix_gid, strip_prefix=prefix, batch=batch, auto_answer=auto_answer)
def CheckAssociatedSystemGroups(self, group, minimal = True, batch = False, auto_answer = None): """Check the system groups that a standard group need to fuction flawlessly. For example, a group "toto" need 2 system groups "resp-toto" and "guest-toto" for its ACLs. """
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
all_went_ok &= self.CheckGroupSymlinks(gid, batch = batch, auto_answer = auto_answer)
all_went_ok &= self.CheckGroupSymlinks(gid, batch=batch, auto_answer=auto_answer)
def __check_group(self, group, minimal = True, batch = False, auto_answer = None):
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
def CheckGroups(self, groups_to_check = [], minimal = True, batch = False, auto_answer = None):
def CheckGroups(self, groups_to_check = [], minimal=True, batch=False, auto_answer=None):
def CheckGroups(self, groups_to_check = [], minimal = True, batch = False, auto_answer = None): """Check the groups, the cache. If not system, check the shared dir, the resps/guests, the members symlinks."""
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
def CheckGroupSymlinks(self, gid = None, group = None, oldname = None, delete = False, strip_prefix = None, batch = False, auto_answer = None):
def CheckGroupSymlinks(self, gid=None, group=None, oldname=None, delete=False, strip_prefix=None, batch=False, auto_answer=None):
def CheckGroupSymlinks(self, gid = None, group = None, oldname = None, delete = False, strip_prefix = None, batch = False, auto_answer = None): """For each member of a group, verify member has a symlink to the shared group dir inside his home (or under level 2 directory). If not, create the link. Eventually delete link...
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
self.CheckGroups( [ name ], batch = True)
self.CheckGroups( [ name ], batch=True)
def SetSharedDirPermissiveness(self, name = None, permissive = True): """ Set permissive or not permissive the shared directory of the group 'name'. """ if name is None: raise exceptions.BadArgumentError, "You must specify a group name."
f37209229adf6c038cbf9bb8cdfd028d8ffe04c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f37209229adf6c038cbf9bb8cdfd028d8ffe04c2/groups.py
dir_info.dirs_perm = "%s,g:%s:rw-,%s,%s" % \
dir_info.dirs_perm = ("%s,g:%s:rw-,%s,%s" % \
def generate_dir_info(self, user_info=None, dir_info_base=None): """ generate a FsapiObject from the rule. This object will be understandable by fsapi """ acl=self.acl
570ec50971fe77441815f76a64ffc26f24c253ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/570ec50971fe77441815f76a64ffc26f24c253ff/classes.py
LMC.configuration.acls.file_acl_mask)
LMC.configuration.acls.file_acl_mask)).replace( '@UX','x').replace('@GX','x')
def generate_dir_info(self, user_info=None, dir_info_base=None): """ generate a FsapiObject from the rule. This object will be understandable by fsapi """ acl=self.acl
570ec50971fe77441815f76a64ffc26f24c253ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/570ec50971fe77441815f76a64ffc26f24c253ff/classes.py
def shutdown(uri, http_user, hostname=None, sure=False, warn_users=True, yes=None):
def shutdown(uri, http_user, hostname=None, sure=False, warn_users=True, yes=None, configuration=None, machines=None, **kwargs):
def shutdown(uri, http_user, hostname=None, sure=False, warn_users=True, yes=None): """ Export machine list.""" # submit button; forget it. del yes title = _("Shutdown machine %s") % hostname data = w.page_body_start(uri, http_user, ctxtnav, title) if not sure: description = _('''Are you sure you want to remotely s...
5c6e0536d2363f635c0b43a50e8af7ca9d102236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5c6e0536d2363f635c0b43a50e8af7ca9d102236/machines.py
active=None, warn_users=None, admin=None, yes=None):
active=None, warn_users=None, admin=None, yes=None, configuration=None, machines=None, **kwargs):
def massshutdown(uri, http_user, sure=False, asleep=None, idle=None, active=None, warn_users=None, admin=None, yes=None): """ Export machine list.""" # submit button; forget it. del yes title = _("Massive shutdown") data = w.page_body_start(uri, http_user, ctxtnav, title) if not sure: description = _('''You can shu...
5c6e0536d2363f635c0b43a50e8af7ca9d102236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5c6e0536d2363f635c0b43a50e8af7ca9d102236/machines.py
def energyprefs(uri, http_user):
def energyprefs(uri, http_user, configuration=None, machines=None, **kwargs):
def energyprefs(uri, http_user): """ Export machine list.""" # submit button; forget it. del yes title = _("Energy saving policies") if type == "": description = _('''CSV file-format is used by spreadsheets and most ''' '''systems which offer import functionnalities. XML file-format is a ''' '''modern exchange forma...
5c6e0536d2363f635c0b43a50e8af7ca9d102236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5c6e0536d2363f635c0b43a50e8af7ca9d102236/machines.py
def export(uri, http_user, type = "", yes = None):
def export(uri, http_user, type = "", yes=None, configuration=None, machines=None, **kwargs):
def export(uri, http_user, type = "", yes = None): """ Export machine list.""" # submit button; forget it. del yes return (w.HTTP_TYPE_TEXT, "not implemented yet.") title = _("Export machines list") data = '''<div id="banner"> %s %s</div> %s <div id="main"> %s <div id="content"> <h1>%s</h1>''' % ( w.backto(), w.met...
5c6e0536d2363f635c0b43a50e8af7ca9d102236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5c6e0536d2363f635c0b43a50e8af7ca9d102236/machines.py
def forget(uri, http_user, hostname, sure=False, yes=None):
def forget(uri, http_user, hostname, sure=False, yes=None, configuration=None, machines=None, **kwargs):
def forget(uri, http_user, hostname, sure=False, yes=None): """remove machine account.""" # form submit button, forget it. del yes return (w.HTTP_TYPE_TEXT, "not implemented yet.") title = _("Remove machine %s's record") % hostname if protected_user(hostname): return w.forgery_error(title) data = w.page_body_star...
5c6e0536d2363f635c0b43a50e8af7ca9d102236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5c6e0536d2363f635c0b43a50e8af7ca9d102236/machines.py
def new(uri, http_user):
def new(uri, http_user, configuration=None, machines=None, **kwargs):
def new(uri, http_user): """Generate a form to create a new machine on the system.""" return (w.HTTP_TYPE_TEXT, "not implemented yet.") title = _("New machine record") data = w.page_body_start(uri, http_user, ctxtnav, title, False) def profile_input(): #TODO: To be rewritten ? return """ <tr> <td><strong>%s</stron...
5c6e0536d2363f635c0b43a50e8af7ca9d102236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5c6e0536d2363f635c0b43a50e8af7ca9d102236/machines.py
create = None ):
create=None, configuration=None, machines=None, **kwargs):
def create(uri, http_user, loginShell, password, password_confirm, profile=None, hostname="", gecos="", firstname="", lastname="", standard_groups_dest=[], privileged_groups_dest=[], responsible_groups_dest=[], guest_groups_dest=[], standard_groups_source=[], privileged_groups_source=[], responsible_groups_source=[], g...
5c6e0536d2363f635c0b43a50e8af7ca9d102236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5c6e0536d2363f635c0b43a50e8af7ca9d102236/machines.py
def edit(uri, http_user, hostname):
def edit(uri, http_user, hostname, configuration=None, machines=None, **kwargs):
def edit(uri, http_user, hostname): """Edit an machine record, based on hostname.""" return (w.HTTP_TYPE_TEXT, "not implemented yet.") title = _("Edit %s's record") % hostname if protected_user(hostname): return w.forgery_error(title) data = w.page_body_start(uri, http_user, ctxtnav, title, False) try: machine = ...
5c6e0536d2363f635c0b43a50e8af7ca9d102236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5c6e0536d2363f635c0b43a50e8af7ca9d102236/machines.py
record = None):
record=None, configuration=None, machines=None, **kwargs):
def record(uri, http_user, hostname, loginShell=None, password = "", password_confirm = "", firstname = "", lastname = "", gecos = "", standard_groups_source = [], standard_groups_dest = [], privileged_groups_source = [], privileged_groups_dest = [], responsible_groups_source = [], responsible_groups_dest = [],...
5c6e0536d2363f635c0b43a50e8af7ca9d102236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5c6e0536d2363f635c0b43a50e8af7ca9d102236/machines.py
def main(uri, http_user, sort = "hostname", order = "asc"):
def main(uri, http_user, sort="hostname", order="asc", configuration=None, machines=None, **kwargs):
def main(uri, http_user, sort = "hostname", order = "asc"): """ display all machines in a nice HTML page. """ start = time.time() m = machines.machines accounts = {} ordered = {} totals = { _('managed'): 0, _('floating'): 0 } title = _("Machines") data = w.page_body_start(uri, http_user, ctxtnav, title) if ord...
5c6e0536d2363f635c0b43a50e8af7ca9d102236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/5c6e0536d2363f635c0b43a50e8af7ca9d102236/machines.py
groups_filters_lists_ids = ( (name, ( _('Manage members'), _('Users not yet members'), _('Current members') ), 'members' ), (configuration.groups.resp_prefix + name, None, '& (configuration.groups.guest_prefix + name, None, '& )
groups_filters_lists_ids = [ (name, [ _('Manage members'), _('Users not yet members'), _('Current members') ], 'members' ) ]
def edit(uri, http_user, name): """Edit a group.""" users.reload() groups.reload() u = users.users g = groups.groups title = _("Editing group %s") % name data = w.page_body_start(uri, http_user, ctxtnav, title, False) try: group = g[groups.name_to_gid(name)] sys = groups.is_system_group(name) dbl_lists ...
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
(name, [_('Manage members'),
(name, [_('Manage members'),
def edit(uri, http_user, name): """Edit a group.""" users.reload() groups.reload() u = users.users g = groups.groups title = _("Editing group %s") % name data = w.page_body_start(uri, http_user, ctxtnav, title, False) try: group = g[groups.name_to_gid(name)] sys = groups.is_system_group(name) dbl_lists ...
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
dest = list(g[groups.name_to_gid(gname)]['memberUid'])
dest = list(group['memberUid'])
def edit(uri, http_user, name): """Edit a group.""" users.reload() groups.reload() u = users.users g = groups.groups title = _("Editing group %s") % name data = w.page_body_start(uri, http_user, ctxtnav, title, False) try: group = g[groups.name_to_gid(name)] sys = groups.is_system_group(name) dbl_lists ...
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
for current in g[groups.name_to_gid(gname)]['memberUid']: try: source.remove(current) except ValueError: dest.remove(current)
for current in group['memberUid']: try: source.remove(current) except ValueError: dest.remove(current)
def edit(uri, http_user, name): """Edit a group.""" users.reload() groups.reload() u = users.users g = groups.groups title = _("Editing group %s") % name data = w.page_body_start(uri, http_user, ctxtnav, title, False) try: group = g[groups.name_to_gid(name)] sys = groups.is_system_group(name) dbl_lists ...
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
if system: return '' else: return '''
return '' if system else \ '''
def skel(cur_skel, system): if system: return '' else: return ''' <tr> <td><strong>%s</strong></td> <td class="right">%s</td> </tr> ''' % (_('Skeleton'), w.select('skel', configuration.users.skels, cur_skel, func = os.path.basename))
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
if system: return '' else: return '''
return '' if system else \ '''
def permissive(perm, system):
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
<h2 class="accordion_toggle">≫&nbsp;%s</h2> <div class="accordion_content">%s</div> <h2 class="accordion_toggle">≫&nbsp;%s</h2> <div class="accordion_content">%s</div>
%s
def permissive(perm, system):
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
_('Group responsibles'), dbl_lists[configuration.groups.resp_prefix+name], _('Group guests'), dbl_lists[configuration.groups.guest_prefix+name],
data_rsp_gst,
def permissive(perm, system):
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
for member in groups.groups[gid]['memberUid']:
for member in group['memberUid']:
def main(uri, http_user, sort = "name", order = "asc"): """List all groups and provileges on the system, displaying them in a nice HTML page. """ start = time.time() users.reload() groups.reload() #profiles.reload() g = groups.groups users.Select(users.FILTER_STANDARD) tgroups = {} totals = {} title = _('Group...
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
tgroups[gid][prefix + 'members'] = []
tgroups[gid][prefix + 'memberUid'] = []
def main(uri, http_user, sort = "name", order = "asc"): """List all groups and provileges on the system, displaying them in a nice HTML page. """ start = time.time() users.reload() groups.reload() #profiles.reload() g = groups.groups users.Select(users.FILTER_STANDARD) tgroups = {} totals = {} title = _('Group...
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
tgroups[gid][prefix + 'members'].append(
tgroups[gid][prefix + 'memberUid'].append(
def main(uri, http_user, sort = "name", order = "asc"): """List all groups and provileges on the system, displaying them in a nice HTML page. """ start = time.time() users.reload() groups.reload() #profiles.reload() g = groups.groups users.Select(users.FILTER_STANDARD) tgroups = {} totals = {} title = _('Group...
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
('members', _('Current members')), ('rsp-members', _('Current responsibles')), ('gst-members', _('Current guests')) ):
('memberUid', _('Current members')), ('rsp-memberUid', _('Current responsibles')), ('gst-memberUid', _('Current guests')) ):
def html_build_group(index, tgroups = tgroups ): gid = ordered[index] name = g[gid]['name'] html_data = '''
b115301aa7a3230e2ebf55808ae6e08d4c08f2cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/b115301aa7a3230e2ebf55808ae6e08d4c08f2cc/groups.py
if prim_memb != []:
if prim_memb != set():
def DeleteGroup(self, name, del_users, no_archive, bygid = None, batch=False): """ Delete an Licorn group """ if name is None and bygid is None: raise exceptions.BadArgumentError, "You must specify a name or a GID."
c27b6e04ed14edea434836815f36e1d3d68ed523 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/c27b6e04ed14edea434836815f36e1d3d68ed523/groups.py
return GroupsController.is_standard_gid(gid) and GroupsController.groups[gid]['memberUid'] == []
return GroupsController.is_standard_gid(gid) and GroupsController.groups[gid]['memberUid'] == set()
def is_empty_gid(gid): return GroupsController.is_standard_gid(gid) and GroupsController.groups[gid]['memberUid'] == []
c27b6e04ed14edea434836815f36e1d3d68ed523 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/c27b6e04ed14edea434836815f36e1d3d68ed523/groups.py
def get_groups(self, opts, args): """ Get the list of POSIX LMC.groups (can be LDAP). """
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
logging.warning("can't automatically detect the file encoding, assuming iso-8859-15 !")
logging.warning("can't automatically detect the file encoding, assuming iso-8859-15!")
def clean_csv_field(field): return field.replace("'","").replace('"','')
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
def clean_csv_field(field): return field.replace("'","").replace('"','')
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
def clean_csv_field(field): return field.replace("'","").replace('"','')
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
def clean_csv_field(field): return field.replace("'","").replace('"','')
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
def clean_csv_field(field): return field.replace("'","").replace('"','')
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
def clean_csv_field(field): return field.replace("'","").replace('"','')
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
def desimport_groups(self, opts, args): """ Delete the groups (and theyr members) present in a import file. """
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'Are you sure you want to delete all users ?',
'Are you sure you want to delete all users?',
def del_user(self, opts, args): """ delete a user account. """ include_id_lists=[ (opts.login, LMC.users.login_to_uid), (opts.uid, LMC.users.confirm_uid) ] exclude_id_lists=[ (opts.exclude, LMC.users.guess_identifier), (opts.exclude_login, LMC.users.login_to_uid), (opts.exclude_uid, LMC.users.confirm_uid), ([os.getuid(...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
(LMC.users.Select(filters.STD), LMC.users.confirm_uid), (LMC.users.Select(filters.SYSUNRSTR), LMC.users.confirm_uid)
(LMC.users.Select(filters.STD), lambda x: x), (LMC.users.Select(filters.SYSUNRSTR), lambda x: x)
def del_user(self, opts, args): """ delete a user account. """ include_id_lists=[ (opts.login, LMC.users.login_to_uid), (opts.uid, LMC.users.confirm_uid) ] exclude_id_lists=[ (opts.exclude, LMC.users.guess_identifier), (opts.exclude_login, LMC.users.login_to_uid), (opts.exclude_uid, LMC.users.confirm_uid), ([os.getuid(...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
logging.ask_for_repair('''Delete user %s ?''' % stylize(
logging.ask_for_repair('''Delete user %s?''' % stylize(
def del_user(self, opts, args): """ delete a user account. """ include_id_lists=[ (opts.login, LMC.users.login_to_uid), (opts.uid, LMC.users.confirm_uid) ] exclude_id_lists=[ (opts.exclude, LMC.users.guess_identifier), (opts.exclude_login, LMC.users.login_to_uid), (opts.exclude_uid, LMC.users.confirm_uid), ([os.getuid(...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'Are you sure you want to delete all groups ?',
'Are you sure you want to delete all groups?',
def del_group(self, opts, args): """ delete an Licorn group. """ selection = filters.NONE if opts.empty: selection = filters.EMPTY include_id_lists=[ (opts.name, LMC.groups.name_to_gid), (opts.gid, LMC.groups.confirm_gid), ] exclude_id_lists = [ (opts.exclude, LMC.groups.guess_identifier), (opts.exclude_group, LMC.grou...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
(LMC.groups.Select(filters.STD), LMC.groups.confirm_gid), (LMC.groups.Select(filters.SYSUNRSTR), LMC.groups.confirm_gid)
(LMC.groups.Select(filters.STD), lambda x: x), (LMC.groups.Select(filters.SYSUNRSTR), lambda x: x)
def del_group(self, opts, args): """ delete an Licorn group. """ selection = filters.NONE if opts.empty: selection = filters.EMPTY include_id_lists=[ (opts.name, LMC.groups.name_to_gid), (opts.gid, LMC.groups.confirm_gid), ] exclude_id_lists = [ (opts.exclude, LMC.groups.guess_identifier), (opts.exclude_group, LMC.grou...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
logging.ask_for_repair('''Delete group %s ?''' % stylize(
logging.ask_for_repair('''Delete group %s?''' % stylize(
def del_group(self, opts, args): """ delete an Licorn group. """ selection = filters.NONE if opts.empty: selection = filters.EMPTY include_id_lists=[ (opts.name, LMC.groups.name_to_gid), (opts.gid, LMC.groups.confirm_gid), ] exclude_id_lists = [ (opts.exclude, LMC.groups.guess_identifier), (opts.exclude_group, LMC.grou...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'Are you sure you want to delete all profiles ?',
'Are you sure you want to delete all profiles?',
def del_profile(self, opts, args): """ Delete a system wide User profile. """ include_id_lists=[ (opts.name, LMC.profiles.name_to_group), (opts.group, LMC.profiles.confirm_group) ] exclude_id_lists=[ (opts.exclude, LMC.profiles.guess_identifier) ] if opts.all and ( ( # NOTE TO THE READER: don't event try to simplify th...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
(LMC.profiles.Select(filters.ALL), LMC.profiles.guess_identifier)
(LMC.profiles.Select(filters.ALL), lambda x: x)
def del_profile(self, opts, args): """ Delete a system wide User profile. """ include_id_lists=[ (opts.name, LMC.profiles.name_to_group), (opts.group, LMC.profiles.confirm_group) ] exclude_id_lists=[ (opts.exclude, LMC.profiles.guess_identifier) ] if opts.all and ( ( # NOTE TO THE READER: don't event try to simplify th...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
logging.ask_for_repair('''Delete profile %s ?''' %
logging.ask_for_repair('''Delete profile %s?''' %
def del_profile(self, opts, args): """ Delete a system wide User profile. """ include_id_lists=[ (opts.name, LMC.profiles.name_to_group), (opts.group, LMC.profiles.confirm_group) ] exclude_id_lists=[ (opts.exclude, LMC.profiles.guess_identifier) ] if opts.all and ( ( # NOTE TO THE READER: don't event try to simplify th...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'Are you sure you want to delete all users ?',
'Are you sure you want to delete all privileges?',
def del_privilege(self, opts, args): if opts.privileges_to_remove is None and len(args) == 2: opts.privileges_to_remove = args[1] include_priv_lists=[ (opts.privileges_to_remove, LMC.privileges.confirm_privilege), ] exclude_priv_lists=[ (opts.exclude, LMC.privileges.confirm_privilege), ] if opts.all and ( ( # NOTE TO T...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
(LMC.privileges.Select(filters.ALL), LMC.privileges.confirm_privilege),
(LMC.privileges.Select(filters.ALL), lambda x: x),
def del_privilege(self, opts, args): if opts.privileges_to_remove is None and len(args) == 2: opts.privileges_to_remove = args[1] include_priv_lists=[ (opts.privileges_to_remove, LMC.privileges.confirm_privilege), ] exclude_priv_lists=[ (opts.exclude, LMC.privileges.confirm_privilege), ] if opts.all and ( ( # NOTE TO T...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
logging.ask_for_repair('''Delete privilege %s ?''' %
logging.ask_for_repair('''Delete privilege %s?''' %
def del_privilege(self, opts, args): if opts.privileges_to_remove is None and len(args) == 2: opts.privileges_to_remove = args[1] include_priv_lists=[ (opts.privileges_to_remove, LMC.privileges.confirm_privilege), ] exclude_priv_lists=[ (opts.exclude, LMC.privileges.confirm_privilege), ] if opts.all and ( ( # NOTE TO T...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'Are you sure you want to modify all users ?',
'Are you sure you want to modify all users?',
def mod_user(self, opts, args): """ Modify a POSIX user account (Samba / LDAP included). """
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
logging.ask_for_repair('''Modify user %s ?''' % stylize(
logging.ask_for_repair('''Modify user %s?''' % stylize(
def mod_user(self, opts, args): """ Modify a POSIX user account (Samba / LDAP included). """
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'''about user(s) ? Use --help to know !''')
'''about user(s)? Use --help to know!''')
def mod_user(self, opts, args): """ Modify a POSIX user account (Samba / LDAP included). """
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'Are you sure you want to modify all groups ?',
'Are you sure you want to modify all groups?',
def mod_group(self, opts, args): """ Modify a group. """ include_id_lists=[ (opts.name, LMC.groups.name_to_gid), (opts.gid, LMC.groups.confirm_gid) ] exclude_id_lists = [ (opts.exclude, LMC.groups.guess_identifier), (opts.exclude_group, LMC.groups.name_to_gid), (opts.exclude_gid, LMC.groups.confirm_gid) ] if opts.all a...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
(LMC.groups.Select(filters.STD), LMC.groups.confirm_gid), (LMC.groups.Select(filters.SYSUNRSTR), LMC.groups.confirm_gid)
(LMC.groups.Select(filters.STD), lambda x: x), (LMC.groups.Select(filters.SYSUNRSTR), lambda x: x)
def mod_group(self, opts, args): """ Modify a group. """ include_id_lists=[ (opts.name, LMC.groups.name_to_gid), (opts.gid, LMC.groups.confirm_gid) ] exclude_id_lists = [ (opts.exclude, LMC.groups.guess_identifier), (opts.exclude_group, LMC.groups.name_to_gid), (opts.exclude_gid, LMC.groups.confirm_gid) ] if opts.all a...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
logging.ask_for_repair('''Modify group %s ?''' % stylize(
logging.ask_for_repair('''Modify group %s?''' % stylize(
def mod_group(self, opts, args): """ Modify a group. """ include_id_lists=[ (opts.name, LMC.groups.name_to_gid), (opts.gid, LMC.groups.confirm_gid) ] exclude_id_lists = [ (opts.exclude, LMC.groups.guess_identifier), (opts.exclude_group, LMC.groups.name_to_gid), (opts.exclude_gid, LMC.groups.confirm_gid) ] if opts.all a...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'Are you sure you want to modify all profiles ?',
'Are you sure you want to modify all profiles?',
def mod_profile(self, opts, args): """ Modify a system wide User profile. """ include_id_lists=[ (opts.name, LMC.profiles.name_to_group), (opts.group, LMC.profiles.confirm_group) ] exclude_id_lists=[ (opts.exclude, LMC.profiles.guess_identifier), ] if opts.all and ( ( # NOTE TO THE READER: don't event try to simplify t...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
(LMC.profiles.Select(filters.ALL), LMC.profiles.guess_identifier)
(LMC.profiles.Select(filters.ALL), lambda x: x)
def mod_profile(self, opts, args): """ Modify a system wide User profile. """ include_id_lists=[ (opts.name, LMC.profiles.name_to_group), (opts.group, LMC.profiles.confirm_group) ] exclude_id_lists=[ (opts.exclude, LMC.profiles.guess_identifier), ] if opts.all and ( ( # NOTE TO THE READER: don't event try to simplify t...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
logging.ask_for_repair('''Modify profile %s ?''' % stylize(
logging.ask_for_repair('''Modify profile %s?''' % stylize(
def mod_profile(self, opts, args): """ Modify a system wide User profile. """ include_id_lists=[ (opts.name, LMC.profiles.name_to_group), (opts.group, LMC.profiles.confirm_group) ] exclude_id_lists=[ (opts.exclude, LMC.profiles.guess_identifier), ] if opts.all and ( ( # NOTE TO THE READER: don't event try to simplify t...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
"what do you want to modify ? use --help to know !")
"what do you want to modify? use --help to know!")
def mod_configuration(self, opts, args): """ Modify some aspects or abstract directives of the system configuration (use with caution)."""
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'Are you sure you want to check all users ?',
'Are you sure you want to check all users?',
def chk_user(self, opts, args): """ Check one or more user account(s). """ include_id_lists=[ (opts.login, LMC.users.login_to_uid), (opts.uid, LMC.users.confirm_uid) ] exclude_id_lists=[ (opts.exclude, LMC.users.guess_identifier), (opts.exclude_login, LMC.users.login_to_uid), (opts.exclude_uid, LMC.users.confirm_uid) ]...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
(LMC.users.Select(filters.STD), LMC.users.confirm_uid), (LMC.users.Select(filters.SYSUNRSTR), LMC.users.confirm_uid)
(LMC.users.Select(filters.STD), lambda x: x), (LMC.users.Select(filters.SYSUNRSTR), lambda x: x)
def chk_user(self, opts, args): """ Check one or more user account(s). """ include_id_lists=[ (opts.login, LMC.users.login_to_uid), (opts.uid, LMC.users.confirm_uid) ] exclude_id_lists=[ (opts.exclude, LMC.users.guess_identifier), (opts.exclude_login, LMC.users.login_to_uid), (opts.exclude_uid, LMC.users.confirm_uid) ]...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
if logging.ask_for_repair('''Check user %s ?''' %
if logging.ask_for_repair('''Check user %s?''' %
def chk_user(self, opts, args): """ Check one or more user account(s). """ include_id_lists=[ (opts.login, LMC.users.login_to_uid), (opts.uid, LMC.users.confirm_uid) ] exclude_id_lists=[ (opts.exclude, LMC.users.guess_identifier), (opts.exclude_login, LMC.users.login_to_uid), (opts.exclude_uid, LMC.users.confirm_uid) ]...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'Are you sure you want to check all groups ?',
'Are you sure you want to check all groups?',
def chk_group(self, opts, args): """ Check one or more group(s). """ include_id_lists=[ (opts.name, LMC.groups.name_to_gid), (opts.gid, LMC.groups.confirm_gid) ] exclude_id_lists = [ (opts.exclude, LMC.groups.guess_identifier), (opts.exclude_group, LMC.groups.name_to_gid), (opts.exclude_gid, LMC.groups.confirm_gid) ] i...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
(LMC.groups.Select(filters.STD), LMC.groups.confirm_gid), (LMC.groups.Select(filters.SYSUNRSTR), LMC.groups.confirm_gid)
(LMC.groups.Select(filters.STD), lambda x: x), (LMC.groups.Select(filters.SYSUNRSTR), lambda x: x)
def chk_group(self, opts, args): """ Check one or more group(s). """ include_id_lists=[ (opts.name, LMC.groups.name_to_gid), (opts.gid, LMC.groups.confirm_gid) ] exclude_id_lists = [ (opts.exclude, LMC.groups.guess_identifier), (opts.exclude_group, LMC.groups.name_to_gid), (opts.exclude_gid, LMC.groups.confirm_gid) ] i...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
if logging.ask_for_repair('''Check group %s ?''' %
if logging.ask_for_repair('''Check group %s?''' %
def chk_group(self, opts, args): """ Check one or more group(s). """ include_id_lists=[ (opts.name, LMC.groups.name_to_gid), (opts.gid, LMC.groups.confirm_gid) ] exclude_id_lists = [ (opts.exclude, LMC.groups.guess_identifier), (opts.exclude_group, LMC.groups.name_to_gid), (opts.exclude_gid, LMC.groups.confirm_gid) ] i...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
'Are you sure you want to delete all profiles ?',
'Are you sure you want to delete all profiles?',
def chk_profile(self, opts, args): """ TODO: to be implemented. """ include_id_lists=[ (opts.name, LMC.profiles.name_to_group), (opts.group, LMC.profiles.confirm_group) ] exclude_id_lists=[ (opts.exclude, LMC.profiles.guess_identifier) ] if opts.all and ( ( # NOTE TO THE READER: don't event try to simplify these condit...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
(LMC.profiles.Select(filters.ALL), LMC.profiles.guess_identifier)
(LMC.profiles.Select(filters.ALL), lambda x: x)
def chk_profile(self, opts, args): """ TODO: to be implemented. """ include_id_lists=[ (opts.name, LMC.profiles.name_to_group), (opts.group, LMC.profiles.confirm_group) ] exclude_id_lists=[ (opts.exclude, LMC.profiles.guess_identifier) ] if opts.all and ( ( # NOTE TO THE READER: don't event try to simplify these condit...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
logging.ask_for_repair('''Delete profile %s ?''' % stylize(
logging.ask_for_repair('''Delete profile %s?''' % stylize(
def chk_profile(self, opts, args): """ TODO: to be implemented. """ include_id_lists=[ (opts.name, LMC.profiles.name_to_group), (opts.group, LMC.profiles.confirm_group) ] exclude_id_lists=[ (opts.exclude, LMC.profiles.guess_identifier) ] if opts.all and ( ( # NOTE TO THE READER: don't event try to simplify these condit...
a1acd345c6b587c46acec53d660359e9c2c78c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a1acd345c6b587c46acec53d660359e9c2c78c73/rwi.py
""" Display a styles.stylized error message and exit badly. """
""" Display a stylized error message and exit badly. """
def error(mesg, returncode=1, full=False, tb=None, listener=None): """ Display a styles.stylized error message and exit badly. """ if full: if tb: sys.stderr.write(tb + '\n') else: import traceback sys.stderr.write ('''>>> %s: ''' % (styles.stylize(styles.ST_OK, "Call trace"))) traceback.print_tb( sys.exc_info()[2] )...
a4712f82b2f0d14c0f1c465fc523b05667dfb57d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a4712f82b2f0d14c0f1c465fc523b05667dfb57d/logging.py
''' % (styles.stylize(styles.ST_OK, "Call trace")))
''' % (stylize(ST_OK, "Call trace")))
def error(mesg, returncode=1, full=False, tb=None, listener=None): """ Display a styles.stylized error message and exit badly. """ if full: if tb: sys.stderr.write(tb + '\n') else: import traceback sys.stderr.write ('''>>> %s: ''' % (styles.stylize(styles.ST_OK, "Call trace"))) traceback.print_tb( sys.exc_info()[2] )...
a4712f82b2f0d14c0f1c465fc523b05667dfb57d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a4712f82b2f0d14c0f1c465fc523b05667dfb57d/logging.py
styles.stylize(styles.ST_BAD, 'ERROR:'),
stylize(ST_BAD, 'ERROR:'),
def error(mesg, returncode=1, full=False, tb=None, listener=None): """ Display a styles.stylized error message and exit badly. """ if full: if tb: sys.stderr.write(tb + '\n') else: import traceback sys.stderr.write ('''>>> %s: ''' % (styles.stylize(styles.ST_OK, "Call trace"))) traceback.print_tb( sys.exc_info()[2] )...
a4712f82b2f0d14c0f1c465fc523b05667dfb57d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a4712f82b2f0d14c0f1c465fc523b05667dfb57d/logging.py
"""Display a styles.stylized warning message on stderr."""
"""Display a stylized warning message on stderr."""
def warning(mesg, once=False, listener=None): """Display a styles.stylized warning message on stderr.""" if once: try: already_displayed = __warningsdb[mesg] return except KeyError, e: __warningsdb[mesg] = True text_message = "%s%s %s\n" % ( styles.stylize(styles.ST_WARNING, '/!\\'), mytime(), mesg) if listener: lis...
a4712f82b2f0d14c0f1c465fc523b05667dfb57d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a4712f82b2f0d14c0f1c465fc523b05667dfb57d/logging.py
styles.stylize(styles.ST_WARNING, '/!\\'), mytime(), mesg)
stylize(ST_WARNING, '/!\\'), mytime(), mesg)
def warning(mesg, once=False, listener=None): """Display a styles.stylized warning message on stderr.""" if once: try: already_displayed = __warningsdb[mesg] return except KeyError, e: __warningsdb[mesg] = True text_message = "%s%s %s\n" % ( styles.stylize(styles.ST_WARNING, '/!\\'), mytime(), mesg) if listener: lis...
a4712f82b2f0d14c0f1c465fc523b05667dfb57d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a4712f82b2f0d14c0f1c465fc523b05667dfb57d/logging.py