Revision f81c4737 lib/backend.py
b/lib/backend.py | ||
---|---|---|
47 | 47 |
import tempfile |
48 | 48 |
import zlib |
49 | 49 |
import base64 |
50 |
import signal |
|
50 | 51 |
|
51 | 52 |
from ganeti import errors |
52 | 53 |
from ganeti import utils |
... | ... | |
2845 | 2846 |
return result |
2846 | 2847 |
|
2847 | 2848 |
|
2849 |
def AbortImportExport(name): |
|
2850 |
"""Sends SIGTERM to a running import/export daemon. |
|
2851 |
|
|
2852 |
""" |
|
2853 |
logging.info("Abort import/export %s", name) |
|
2854 |
|
|
2855 |
status_dir = utils.PathJoin(constants.IMPORT_EXPORT_DIR, name) |
|
2856 |
pid = utils.ReadLockedPidFile(utils.PathJoin(status_dir, _IES_PID_FILE)) |
|
2857 |
|
|
2858 |
if pid: |
|
2859 |
logging.info("Import/export %s is running with PID %s, sending SIGTERM", |
|
2860 |
name, pid) |
|
2861 |
os.kill(pid, signal.SIGTERM) |
|
2862 |
|
|
2863 |
|
|
2848 | 2864 |
def CleanupImportExport(name): |
2849 | 2865 |
"""Cleanup after an import or export. |
2850 | 2866 |
|
Also available in: Unified diff