Skip to content

Commit

Permalink
Revert "update mail-alarm and usb_scan to python3"
Browse files Browse the repository at this point in the history
This reverts commit 3259196.

We've seen in the testsuite likely caused by this change:
```
Unexpected exception in message hook /opt/xensource/libexec/mail-alarm: INTERNAL_ERROR: [ Subprocess exited with unexpected code 1; stdout = [  ]; stderr = [ Traceback (most recent call last):\x0A\x0A  File "/opt/xensource/libexec/mail-alarm", line 1055, in <module>\x0A    rc = main()\x0A\x0A  File "/opt/xensource/libexec/mail-alarm", line 1027, in main\x0A    os.write(fd, config)\x0A\x0ATypeError: a bytes-like object is required, not 'str'\x0A\x0A ] ]
```

Signed-off-by: Edwin Török <[email protected]>
  • Loading branch information
edwintorok committed Jan 16, 2024
1 parent b55c748 commit 0099ca8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
18 changes: 9 additions & 9 deletions scripts/mail-alarm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
#
# mail-alarm: uses ssmtp to send a mail message, to pool:other_config:mail-destination
#
Expand All @@ -11,18 +11,18 @@
# the only thing that needs be set is pool:other-config:ssmtp-mailhub

from __future__ import print_function

import json
import os
import re
import XenAPI
import sys
import syslog
import os
import tempfile
import traceback
from socket import getfqdn
import syslog
import json
import re
from xml.dom import minidom

import XenAPI
from xml.sax.saxutils import unescape
from xml.parsers.expat import ExpatError
from socket import getfqdn
from xcp import branding

# Go read man ssmtp.conf
Expand Down
9 changes: 4 additions & 5 deletions scripts/usb_scan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
#
# Copyright (C) Citrix Systems Inc.
#
Expand All @@ -21,17 +21,16 @@
# 2. check if device can be passed through based on policy file
# 3. return the device info to XAPI in json format


from __future__ import print_function
import abc
import argparse
import json
import xcp.logger as log
import logging
import pyudev
import re
import sys

import pyudev
import xcp.logger as log


def log_list(l):
for s in l:
Expand Down

0 comments on commit 0099ca8

Please sign in to comment.