Opened 12 years ago

Closed 12 years ago

#10351 closed Bug Report - General (Fixed)

Python bindings failure when MasterServer=BackendServerIP6

Reported by: Bill Meek <keemllib@…> Owned by: Raymond Wagner
Priority: minor Milestone: 0.25
Component: Bindings - Python Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Running on: v0.25pre-4589-gf4a1079.

To duplicate, create this fragment of a python script.

#!/usr/bin/env python
from MythTV import MythBE
be = MythBE()

Executing the above results in:

Traceback (most recent call last):
  File "/home/bill/bin/test.py", line 3, in <module>
  be = MythBE()
    File "/usr/local/lib/python2.7/dist-packages/MythTV/mythproto.py", line 97, in __init__
    self.host)
    MythTV.exceptions.MythDBError: Could not find setting 'BackendServerIP' on host 'fd00::f00'

The following allows the script above (and find-orphans) to run:

diff --git a/mythtv/bindings/python/MythTV/mythproto.py b/mythtv/bindings/python/MythTV/mythproto.py
index a8420f9..476c13c 100644
--- a/mythtv/bindings/python/MythTV/mythproto.py
+++ b/mythtv/bindings/python/MythTV/mythproto.py
@@ -91,9 +91,10 @@ class BECache( object ):
             with self.db.cursor(self.log) as cursor:
                 if cursor.execute("""SELECT hostname FROM settings
                                      WHERE value='BackendServerIP'
+                                     OR value='BackendServerIP6'
                                      AND data=?""", [self.host]) == 0:
                     # no match found
-                    raise MythDBError(MythError.DB_SETTING, 'BackendServerIP',
+                    raise MythDBError(MythError.DB_SETTING, 'BackendServerIP/6',
                                             self.host)
                 self.hostname = cursor.fetchone()[0]

~

Change History (2)

comment:1 Changed 12 years ago by Raymond Wagner

Milestone: unknown0.25
Status: newaccepted

comment:2 Changed 12 years ago by Raymond Wagner

Resolution: Fixed
Status: acceptedclosed

Correct handling of IP addresses in Python bindings.

This adds support for proper forward and reverse host resolution using the new BackendServerIP6 setting.

Fixes #10351

Branch: master
Changeset: 8b509a01cb17cd92010b24d28f0c343ffc454b25

Note: See TracTickets for help on using tickets.