ogClonningEnginetest-python-scriptsticket-693ticket-700
Last change
on this file since 1b42de9 was
5b1449d,
checked in by Antonio Emmanuel Guerrero Silva <aguerrero@…>, 7 months ago
|
refs #700 shared files convert to Python3
|
-
Property mode set to
100644
|
File size:
897 bytes
|
Line | |
---|
1 | import os |
---|
2 | import subprocess |
---|
3 | import sys |
---|
4 | |
---|
5 | #!/usr/bin/env python3 |
---|
6 | """ |
---|
7 | @file metadevs.py |
---|
8 | @brief Script de inicio para detectar metadispositivos LVM y RAID. |
---|
9 | @note Desglose del script "loadenviron.sh". |
---|
10 | @warning License: GNU GPLv3+ |
---|
11 | """ |
---|
12 | |
---|
13 | def main(): |
---|
14 | opengnsys = os.getenv('OPENGNSYS') |
---|
15 | msg_detectlvmraid = os.getenv('MSG_DETECTLVMRAID', '') |
---|
16 | |
---|
17 | if opengnsys: |
---|
18 | print(msg_detectlvmraid) |
---|
19 | # Detectar metadispositivos LVM. |
---|
20 | subprocess.run(['vgchange', '-ay'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
---|
21 | # Detectar metadispositivos RAID. |
---|
22 | subprocess.run(['dmraid', '-ay'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
---|
23 | else: |
---|
24 | # FIXME Error: entorno de OpenGnsys no configurado. |
---|
25 | print("Error: OpenGnsys environment is not configured.") # FIXME: definir mensaje. |
---|
26 | sys.exit(1) |
---|
27 | |
---|
28 | if __name__ == "__main__": |
---|
29 | main() |
---|
Note: See
TracBrowser
for help on using the repository browser.