summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Client/Tools
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-23 09:35:51 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-23 09:35:51 -0400
commit60bec519eadea232ce1f8f52d8fba0e1385858fb (patch)
tree0d67c11d78fdd2f650348b95691e7d9dca546865 /src/lib/Bcfg2/Client/Tools
parent0ce2a95d7fb0f6c4a00b19a5bfd3dcfa88cb90a7 (diff)
downloadbcfg2-60bec519eadea232ce1f8f52d8fba0e1385858fb.tar.gz
bcfg2-60bec519eadea232ce1f8f52d8fba0e1385858fb.tar.bz2
bcfg2-60bec519eadea232ce1f8f52d8fba0e1385858fb.zip
finally a relative import fix that works on py2.4 thru 3.2
Diffstat (limited to 'src/lib/Bcfg2/Client/Tools')
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/Device.py6
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/Directory.py6
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/File.py6
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/Hardlink.py6
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/Nonexistent.py6
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/Permissions.py6
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/Symlink.py6
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/__init__.py6
8 files changed, 40 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/Device.py b/src/lib/Bcfg2/Client/Tools/POSIX/Device.py
index b8fb0f4d0..0ea4128f7 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/Device.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/Device.py
@@ -1,6 +1,10 @@
import os
import sys
-from base import POSIXTool, device_map
+try:
+ from base import POSIXTool, device_map
+except ImportError:
+ # py3k, incompatible syntax with py2.4
+ exec("from .base import POSIXTool, device_map")
class POSIXDevice(POSIXTool):
__req__ = ['name', 'dev_type', 'perms', 'owner', 'group']
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/Directory.py b/src/lib/Bcfg2/Client/Tools/POSIX/Directory.py
index 4b0ad93ef..d2d383f66 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/Directory.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/Directory.py
@@ -3,7 +3,11 @@ import sys
import stat
import shutil
import Bcfg2.Client.XML
-from base import POSIXTool
+try:
+ from base import POSIXTool
+except ImportError:
+ # py3k, incompatible syntax with py2.4
+ exec("from .base import POSIXTool")
class POSIXDirectory(POSIXTool):
__req__ = ['name', 'perms', 'owner', 'group']
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/File.py b/src/lib/Bcfg2/Client/Tools/POSIX/File.py
index 21e675ac7..26550078e 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/File.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/File.py
@@ -4,7 +4,11 @@ import stat
import time
import difflib
import tempfile
-from base import POSIXTool
+try:
+ from base import POSIXTool
+except ImportError:
+ # py3k, incompatible syntax with py2.4
+ exec("from .base import POSIXTool")
from Bcfg2.Bcfg2Py3k import unicode, b64encode, b64decode
class POSIXFile(POSIXTool):
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/Hardlink.py b/src/lib/Bcfg2/Client/Tools/POSIX/Hardlink.py
index 569ca3445..ca7a23717 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/Hardlink.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/Hardlink.py
@@ -1,6 +1,10 @@
import os
import sys
-from base import POSIXTool
+try:
+ from base import POSIXTool
+except ImportError:
+ # py3k, incompatible syntax with py2.4
+ exec("from .base import POSIXTool")
class POSIXHardlink(POSIXTool):
__req__ = ['name', 'to']
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/Nonexistent.py b/src/lib/Bcfg2/Client/Tools/POSIX/Nonexistent.py
index 64a36cce4..c870ca0ed 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/Nonexistent.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/Nonexistent.py
@@ -1,7 +1,11 @@
import os
import sys
import shutil
-from base import POSIXTool
+try:
+ from base import POSIXTool
+except ImportError:
+ # py3k, incompatible syntax with py2.4
+ exec("from .base import POSIXTool")
class POSIXNonexistent(POSIXTool):
__req__ = ['name']
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/Permissions.py b/src/lib/Bcfg2/Client/Tools/POSIX/Permissions.py
index c041b9ade..321376b98 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/Permissions.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/Permissions.py
@@ -1,6 +1,10 @@
import os
import sys
-from base import POSIXTool
+try:
+ from base import POSIXTool
+except ImportError:
+ # py3k, incompatible syntax with py2.4
+ exec("from .base import POSIXTool")
class POSIXPermissions(POSIXTool):
__req__ = ['name', 'perms', 'owner', 'group']
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/Symlink.py b/src/lib/Bcfg2/Client/Tools/POSIX/Symlink.py
index d5222513e..fb303bdbe 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/Symlink.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/Symlink.py
@@ -1,6 +1,10 @@
import os
import sys
-from base import POSIXTool
+try:
+ from base import POSIXTool
+except ImportError:
+ # py3k, incompatible syntax with py2.4
+ exec("from .base import POSIXTool")
class POSIXSymlink(POSIXTool):
__req__ = ['name', 'to']
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/__init__.py b/src/lib/Bcfg2/Client/Tools/POSIX/__init__.py
index 7e649a2c1..46631eb06 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/__init__.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/__init__.py
@@ -7,7 +7,11 @@ import shutil
import pkgutil
from datetime import datetime
import Bcfg2.Client.Tools
-from base import POSIXTool
+try:
+ from base import POSIXTool
+except ImportError:
+ # py3k, incompatible syntax with py2.4
+ exec("from .base import POSIXTool")
class POSIX(Bcfg2.Client.Tools.Tool):
"""POSIX File support code."""