Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Benjamin Graillot
scripts
Commits
d3c475c6
Commit
d3c475c6
authored
Nov 20, 2013
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ressuscite_lc] Fonctions d'affichages
et on le lance avec un user qui a le droit de se connecter à pgsql
parent
e258966a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
gestion/ressuscite_lc.py
gestion/ressuscite_lc.py
+11
-2
respbats/ressuscite_lc
respbats/ressuscite_lc
+1
-1
No files found.
gestion/ressuscite_lc.py
View file @
d3c475c6
...
...
@@ -30,6 +30,14 @@ def reset_mid(machine, proprio=None):
machine
.
dn
=
"mid=%s,%s"
%
(
machine
[
'mid'
][
0
],
machine
.
dn
.
split
(
','
,
1
)[
1
])
def
display
():
global
coffins
cmp
=
0
for
i
in
coffins
:
print
coul
(
u
"Élement %s de coffins :"
%
cmp
,
'gras'
)
i
.
display
()
cmp
+=
1
class
Edit
(
Exception
):
pass
if
__name__
==
'__main__'
:
...
...
@@ -51,8 +59,9 @@ if __name__ == '__main__':
except
(
lc_ldap
.
attributs
.
UniquenessError
,
Edit
)
as
error
:
msg
=
coul
(
"%s, démarrage d'un shell."
%
error
,
'rouge'
)
msg
+=
"""
Les objets ressucitables sont dans la variable `coffins`.
Une connexion admin à la base ldap dans la variable `conn`.
Les objets ressucitables sont dans la variable
\033
[1;50mcoffins
\033
[1;0m.
Une connexion admin à la base ldap dans la variable
\033
[1;50mconn
\033
[1;0m.
Pour afficher les objects de
\033
[1;50mcoffins
\033
[1;0m, vous pouvez utiliser la fonction
\033
[1;50mdisplay()
\033
[1;0m.
Pour ressuciter les machines, il y a en plus les fonctions :
* reset_mid(machine, proprio=None)
* reset_ip(machine)
...
...
respbats/ressuscite_lc
View file @
d3c475c6
#! /bin/sh
LANG
=
fr_FR.UTF-8 /usr/scripts/gestion/ressuscite_lc.py
$*
LANG
=
fr_FR.UTF-8
sudo
-u
respbats
/usr/scripts/gestion/ressuscite_lc.py
$*
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment