Parcourir la source

[1545] Added reference to python documentation for os.putenv() function.

The os.putenv() functionsseems to be not supported on all platforms and
this is indicated in the python documentation.
Marcin Siodelski il y a 12 ans
Parent
commit
38c6a4866e
2 fichiers modifiés avec 12 ajouts et 4 suppressions
  1. 6 2
      src/bin/dhcp4/tests/dhcp4_test.py
  2. 6 2
      src/bin/dhcp6/tests/dhcp6_test.py

+ 6 - 2
src/bin/dhcp4/tests/dhcp4_test.py

@@ -32,8 +32,12 @@ class TestDhcpv4Daemon(unittest.TestCase):
         #
         # However, we do want to set the logging lock directory to somewhere
         # to which we can write - use the current working directory.  We then
-        # set the appropriate environment variable.  os.putenv() doesn't work
-        # on Ubuntu, so we access os.environ directly.
+        # set the appropriate environment variable.  os.putenv() may be not
+        # supported on some platforms as suggested in
+        # http://docs.python.org/release/3.2/library/os.html?highlight=putenv#os.environ:
+        # "If the platform supports the putenv() function...". It was checked
+        # that it does not work on Ubuntu. To overcome this problem we access
+        # os.environ directly.
         lockdir_envvar = "B10_LOCKFILE_DIR_FROM_BUILD"
         if lockdir_envvar not in os.environ:
             os.environ[lockdir_envvar] = os.getcwd()

+ 6 - 2
src/bin/dhcp6/tests/dhcp6_test.py

@@ -32,8 +32,12 @@ class TestDhcpv6Daemon(unittest.TestCase):
         #
         # However, we do want to set the logging lock directory to somewhere
         # to which we can write - use the current working directory.  We then
-        # set the appropriate environment variable.  os.putenv() doesn't work
-        # on Ubuntu, so we access os.environ directly.
+        # set the appropriate environment variable.  os.putenv() may be not
+        # supported on some platforms as suggested in
+        # http://docs.python.org/release/3.2/library/os.html?highlight=putenv#os.environ:
+        # "If the platform supports the putenv() function...". It was checked
+        # that it does not work on Ubuntu. To overcome this problem we access
+        # os.environ directly.
         lockdir_envvar = "B10_LOCKFILE_DIR_FROM_BUILD"
         if lockdir_envvar not in os.environ:
             os.environ[lockdir_envvar] = os.getcwd()