Browse Source

Merge "Drop bunch dependency"

Jenkins 3 years ago
parent
commit
8c5bc5d9ec

+ 1
- 1
muranoagent/app.py View File

@@ -18,11 +18,11 @@ import sys
18 18
 import time
19 19
 import types
20 20
 
21
-import bunch
22 21
 from oslo_log import log as logging
23 22
 from oslo_service import service
24 23
 import semantic_version
25 24
 
25
+from muranoagent import bunch
26 26
 from muranoagent.common import config
27 27
 from muranoagent.common import messaging
28 28
 from muranoagent import exceptions as exc

+ 29
- 0
muranoagent/bunch.py View File

@@ -0,0 +1,29 @@
1
+#    Copyright (c) 2014 Mirantis, Inc.
2
+#
3
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+#    not use this file except in compliance with the License. You may obtain
5
+#    a copy of the License at
6
+#
7
+#         http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+#    Unless required by applicable law or agreed to in writing, software
10
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+#    License for the specific language governing permissions and limitations
13
+#    under the License.
14
+
15
+
16
+class Bunch(dict):
17
+    """Bunch dict/object-like container.
18
+
19
+    Bunch container provides both dictionary-like and
20
+    object-like attribute access.
21
+    """
22
+    def __getattr__(self, item):
23
+        return self.__getitem__(item)
24
+
25
+    def __setattr__(self, key, value):
26
+        return self.__setitem__(key, value)
27
+
28
+    def __delattr__(self, key):
29
+        del self[key]

+ 1
- 1
muranoagent/execution_plan_queue.py View File

@@ -18,8 +18,8 @@ import os
18 18
 import shutil
19 19
 import time
20 20
 
21
-import bunch
22 21
 
22
+from muranoagent import bunch
23 23
 from muranoagent.common import config
24 24
 
25 25
 CONF = config.CONF

+ 1
- 1
muranoagent/execution_plan_runner.py View File

@@ -15,8 +15,8 @@
15 15
 
16 16
 import sys
17 17
 
18
-import bunch
19 18
 
19
+from muranoagent import bunch
20 20
 from muranoagent import files_manager as fm
21 21
 from muranoagent import script_runner
22 22
 

+ 1
- 1
muranoagent/executors/application/__init__.py View File

@@ -18,9 +18,9 @@ import stat
18 18
 import subprocess
19 19
 import sys
20 20
 
21
-import bunch
22 21
 from oslo_log import log as logging
23 22
 
23
+from muranoagent import bunch
24 24
 import muranoagent.exceptions
25 25
 from muranoagent import executors
26 26
 

+ 1
- 1
muranoagent/executors/chef/__init__.py View File

@@ -13,13 +13,13 @@
13 13
 # See the License for the specific language governing permissions and
14 14
 # limitations under the License.
15 15
 
16
-import bunch
17 16
 import json
18 17
 import os
19 18
 import subprocess
20 19
 
21 20
 from oslo_log import log as logging
22 21
 
22
+from muranoagent import bunch
23 23
 import muranoagent.exceptions
24 24
 from muranoagent import executors
25 25
 from muranoagent.executors import chef_puppet_executor_base

+ 1
- 1
muranoagent/executors/chef_puppet_executor_base.py View File

@@ -13,13 +13,13 @@
13 13
 # See the License for the specific language governing permissions and
14 14
 # limitations under the License.
15 15
 
16
-import bunch
17 16
 import json
18 17
 import os
19 18
 import subprocess
20 19
 
21 20
 from oslo_log import log as logging
22 21
 
22
+from muranoagent import bunch
23 23
 import muranoagent.exceptions
24 24
 from muranoagent import executors
25 25
 

+ 1
- 1
muranoagent/executors/puppet/__init__.py View File

@@ -12,13 +12,13 @@
12 12
 # implied.
13 13
 # See the License for the specific language governing permissions and
14 14
 # limitations under the License.
15
-import bunch
16 15
 import os
17 16
 import subprocess
18 17
 import yaml
19 18
 
20 19
 from oslo_log import log as logging
21 20
 
21
+from muranoagent import bunch
22 22
 import muranoagent.exceptions
23 23
 from muranoagent import executors
24 24
 from muranoagent.executors import chef_puppet_executor_base

+ 2
- 1
muranoagent/tests/unit/execution_plan.py View File

@@ -13,9 +13,10 @@
13 13
 # See the License for the specific language governing permissions and
14 14
 # limitations under the License.
15 15
 
16
-import bunch
17 16
 import fixtures
18 17
 
18
+from muranoagent import bunch
19
+
19 20
 
20 21
 class ExPlanDownloable(fixtures.Fixture):
21 22
     def setUp(self):

+ 1
- 1
muranoagent/tests/unit/executors/test_chef.py View File

@@ -12,13 +12,13 @@
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14 14
 
15
-import bunch
16 15
 import fixtures
17 16
 import json
18 17
 import mock
19 18
 from mock import ANY
20 19
 import os
21 20
 
21
+from muranoagent import bunch
22 22
 from muranoagent.common import config as cfg
23 23
 from muranoagent import exceptions as ex
24 24
 from muranoagent.executors import chef

+ 2
- 1
muranoagent/tests/unit/executors/test_puppet.py View File

@@ -11,10 +11,11 @@
11 11
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14
-import bunch
14
+
15 15
 import fixtures
16 16
 import mock
17 17
 
18
+from muranoagent import bunch
18 19
 from muranoagent.common import config as cfg
19 20
 from muranoagent import exceptions as ex
20 21
 from muranoagent.executors import puppet

+ 1
- 1
muranoagent/tests/unit/test_app.py View File

@@ -12,11 +12,11 @@
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14 14
 
15
-import bunch
16 15
 import fixtures
17 16
 import mock
18 17
 
19 18
 from muranoagent import app
19
+from muranoagent import bunch
20 20
 from muranoagent.common import config as cfg
21 21
 from muranoagent import exceptions as exc
22 22
 from muranoagent.tests.unit import base

+ 1
- 1
muranoagent/tests/unit/test_files_manager.py View File

@@ -12,10 +12,10 @@
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14 14
 
15
-import bunch
16 15
 import mock
17 16
 import os.path
18 17
 
18
+from muranoagent import bunch
19 19
 from muranoagent.common import config as cfg
20 20
 from muranoagent import files_manager
21 21
 from muranoagent.tests.unit import base

+ 1
- 1
muranoagent/tests/unit/test_script_runner.py View File

@@ -12,10 +12,10 @@
12 12
 #    License for the specific language governing permissions and limitations
13 13
 #    under the License.
14 14
 
15
-import bunch
16 15
 import git
17 16
 import mock
18 17
 
18
+from muranoagent import bunch
19 19
 from muranoagent.common import config as cfg
20 20
 from muranoagent import files_manager as fmanager
21 21
 from muranoagent import script_runner

+ 1
- 4
requirements.txt View File

@@ -5,6 +5,7 @@ pbr<2.0,>=0.11
5 5
 anyjson>=0.3.3
6 6
 Babel>=1.3
7 7
 eventlet>=0.17.4
8
+GitPython>=1.0.1 # BSD License (3 clause)
8 9
 iso8601>=0.1.9
9 10
 kombu>=3.0.7
10 11
 oslo.config>=1.11.0 # Apache-2.0
@@ -16,7 +17,3 @@ six>=1.9.0
16 17
 stevedore>=1.5.0 # Apache-2.0
17 18
 semantic-version>=2.3.1
18 19
 requests>=2.5.2
19
-
20
-# not listed in global requirements
21
-bunch
22
-gitpython

Loading…
Cancel
Save