summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource/test_nocloud.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2016-05-11 14:18:02 -0700
committerJoshua Harlow <harlowja@gmail.com>2016-05-11 14:18:02 -0700
commit26ea813d293467921ab6b1e32abd2ab8fcefa3bd (patch)
treebd641e5867bdd96effa33d62e5c200b5dd7e6331 /tests/unittests/test_datasource/test_nocloud.py
parent67e506a50dae2b0c1a806f482670b864e84809ae (diff)
downloadvyos-cloud-init-26ea813d293467921ab6b1e32abd2ab8fcefa3bd.tar.gz
vyos-cloud-init-26ea813d293467921ab6b1e32abd2ab8fcefa3bd.zip
Fix py26 for rhel (and older versions of python)
Diffstat (limited to 'tests/unittests/test_datasource/test_nocloud.py')
-rw-r--r--tests/unittests/test_datasource/test_nocloud.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/tests/unittests/test_datasource/test_nocloud.py b/tests/unittests/test_datasource/test_nocloud.py
index 2d5fc37c..a92dd3b3 100644
--- a/tests/unittests/test_datasource/test_nocloud.py
+++ b/tests/unittests/test_datasource/test_nocloud.py
@@ -1,22 +1,12 @@
from cloudinit import helpers
from cloudinit.sources import DataSourceNoCloud
from cloudinit import util
-from ..helpers import TestCase, populate_dir
+from ..helpers import TestCase, populate_dir, mock, ExitStack
import os
import yaml
import shutil
import tempfile
-import unittest
-
-try:
- from unittest import mock
-except ImportError:
- import mock
-try:
- from contextlib import ExitStack
-except ImportError:
- from contextlib2 import ExitStack
class TestNoCloudDataSource(TestCase):
@@ -139,7 +129,7 @@ class TestNoCloudDataSource(TestCase):
self.assertTrue(ret)
-class TestParseCommandLineData(unittest.TestCase):
+class TestParseCommandLineData(TestCase):
def test_parse_cmdline_data_valid(self):
ds_id = "ds=nocloud"