Description: Tests use /etc/lsb-release in place of temp file
 A tempfile in /tmp would suffice in this instance. Basically tests fail
 if the system running the tests does not have /etc/lsb-release. Ubuntu
 systems have this but Debian 'wheezy' does not. I imagine OS X wouldn't
 have it either.
Author: Clint Byrum <spamaps@debian.org>
Bug: https://bugs.launchpad.net/juju/+bug/1007544
Forwarded: yes, see bug

--- juju-0.5+bzr535.orig/juju/charm/tests/test_directory.py
+++ juju-0.5+bzr535/juju/charm/tests/test_directory.py
@@ -212,16 +212,18 @@ class DirectoryTest(RepositoryTestBase):
 
     def test_internal_symlink(self):
         charm_path = self.copy_charm()
-        os.symlink("/etc/lsb-release", os.path.join(charm_path, "foobar"))
+        with tempfile.NamedTemporaryFile(dir='/tmp') as external_file:
+            os.symlink(external_file.name, os.path.join(charm_path, "foobar"))
 
-        directory = CharmDirectory(charm_path)
-        e = self.assertRaises(InvalidCharmFile, directory.as_bundle)
-        self.assertIn("foobar' Absolute links are invalid", str(e))
+            directory = CharmDirectory(charm_path)
+            e = self.assertRaises(InvalidCharmFile, directory.as_bundle)
+            self.assertIn("foobar' Absolute links are invalid", str(e))
 
     def test_extract_symlink(self):
         charm_path = self.copy_charm()
-        os.symlink("/etc/lsb-release", os.path.join(charm_path, "foobar"))
+        with tempfile.NamedTemporaryFile(dir='/tmp') as external_file:
+            os.symlink(external_file.name, os.path.join(charm_path, "foobar"))
 
-        directory = CharmDirectory(charm_path)
-        e = self.assertRaises(InvalidCharmFile, directory.as_bundle)
-        self.assertIn("foobar' Absolute links are invalid", str(e))
+            directory = CharmDirectory(charm_path)
+            e = self.assertRaises(InvalidCharmFile, directory.as_bundle)
+            self.assertIn("foobar' Absolute links are invalid", str(e))
