|
4 | 4 | # --- BEGIN_HEADER --- |
5 | 5 | # |
6 | 6 | # resadm - Resource administration functions mostly for remote command execution |
7 | | -# Copyright (C) 2003-2023 The MiG Project lead by Brian Vinter |
| 7 | +# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH |
8 | 8 | # |
9 | 9 | # This file is part of MiG. |
10 | 10 | # |
|
30 | 30 | from __future__ import absolute_import |
31 | 31 |
|
32 | 32 | from builtins import range |
| 33 | +import datetime |
| 34 | +import fcntl |
33 | 35 | import os |
34 | 36 | import tempfile |
35 | | -import fcntl |
36 | 37 | import time |
37 | | -import datetime |
38 | 38 |
|
39 | 39 | # MiG imports |
40 | 40 |
|
| 41 | +from mig.shared.base import force_native_str |
41 | 42 | from mig.shared.conf import get_resource_configuration, get_resource_exe, \ |
42 | 43 | get_resource_store, get_configuration_object |
43 | 44 | from mig.shared.fileio import unpickle, pickle |
@@ -364,7 +365,7 @@ def fill_frontend_script( |
364 | 365 | except Exception as err: |
365 | 366 | msg = 'Error: could not write frontend script file' |
366 | 367 | # NOTE: no logger available here |
367 | | - #logger.error("%s: %s" % (msg, err)) |
| 368 | + # logger.error("%s: %s" % (msg, err)) |
368 | 369 | return (False, msg) |
369 | 370 |
|
370 | 371 |
|
@@ -470,7 +471,7 @@ def fill_exe_node_script( |
470 | 471 | except Exception as err: |
471 | 472 | msg = 'could not write exe node script file' |
472 | 473 | # NOTE: no logger available here |
473 | | - #logger.error("%s: %s" % (msg, err)) |
| 474 | + # logger.error("%s: %s" % (msg, err)) |
474 | 475 | return (False, msg) |
475 | 476 |
|
476 | 477 |
|
@@ -599,7 +600,8 @@ def check_mounted(target, logger): |
599 | 600 | if os.path.ismount(target): |
600 | 601 | return True |
601 | 602 | mount_line = ' on %s type fuse.sshfs ' % target |
602 | | - mount_out = subprocess_check_output(['mount']) |
| 603 | + # NOTE: we need output on str format for find below |
| 604 | + mount_out = force_native_str(subprocess_check_output(['mount'])) |
603 | 605 | logger.debug("check_mounted out: %s vs %s" % (mount_out, mount_line)) |
604 | 606 | return (mount_out.find(mount_line) != -1) |
605 | 607 |
|
|
0 commit comments