Browse Source

Merge "Only import os_utils when plugin is called"

Jenkins 1 year ago
parent
commit
aab54fecfd

+ 4
- 1
monitorstack/plugins/os_block_pools_totals.py View File

@@ -17,7 +17,6 @@ import click
17 17
 
18 18
 from monitorstack import utils
19 19
 from monitorstack.cli import pass_context
20
-from monitorstack.utils import os_utils as ost
21 20
 
22 21
 
23 22
 DOC = """Get block storage totals from the available pools."""
@@ -33,6 +32,10 @@ def cli(ctx, config_file):
33 32
     """Get nova cores quotas."""
34 33
     setattr(cli, '__doc__', DOC)
35 34
 
35
+    # Lower level import because we only want to load this module
36
+    # when this plugin is called.
37
+    from monitorstack.utils import os_utils as ost
38
+
36 39
     output = {
37 40
         'measurement_name': COMMAND_NAME,
38 41
         'meta': {

+ 4
- 1
monitorstack/plugins/os_block_pools_usage.py View File

@@ -17,7 +17,6 @@ import click
17 17
 
18 18
 from monitorstack import utils
19 19
 from monitorstack.cli import pass_context
20
-from monitorstack.utils import os_utils as ost
21 20
 
22 21
 
23 22
 DOC = """Get block storage usage from the available pools."""
@@ -33,6 +32,10 @@ def cli(ctx, config_file):
33 32
     """Get nova cores quotas."""
34 33
     setattr(cli, '__doc__', DOC)
35 34
 
35
+    # Lower level import because we only want to load this module
36
+    # when this plugin is called.
37
+    from monitorstack.utils import os_utils as ost
38
+
36 39
     output = {
37 40
         'measurement_name': COMMAND_NAME,
38 41
         'meta': {

+ 4
- 1
monitorstack/plugins/os_vm_quota_cores.py View File

@@ -17,7 +17,6 @@ import click
17 17
 
18 18
 from monitorstack import utils
19 19
 from monitorstack.cli import pass_context
20
-from monitorstack.utils import os_utils as ost
21 20
 
22 21
 
23 22
 DOC = """Get nova cores quotas."""
@@ -33,6 +32,10 @@ def cli(ctx, config_file):
33 32
     """Get nova cores quotas."""
34 33
     setattr(cli, '__doc__', DOC)
35 34
 
35
+    # Lower level import because we only want to load this module
36
+    # when this plugin is called.
37
+    from monitorstack.utils import os_utils as ost
38
+
36 39
     output = {
37 40
         'measurement_name': COMMAND_NAME,
38 41
         'meta': {

+ 4
- 1
monitorstack/plugins/os_vm_quota_instance.py View File

@@ -17,7 +17,6 @@ import click
17 17
 
18 18
 from monitorstack import utils
19 19
 from monitorstack.cli import pass_context
20
-from monitorstack.utils import os_utils as ost
21 20
 
22 21
 
23 22
 DOC = """Get nova instance quotas."""
@@ -33,6 +32,10 @@ def cli(ctx, config_file):
33 32
     """Get nova instance quotas."""
34 33
     setattr(cli, '__doc__', DOC)
35 34
 
35
+    # Lower level import because we only want to load this module
36
+    # when this plugin is called.
37
+    from monitorstack.utils import os_utils as ost
38
+
36 39
     output = {
37 40
         'measurement_name': COMMAND_NAME,
38 41
         'meta': {

+ 4
- 1
monitorstack/plugins/os_vm_quota_ram.py View File

@@ -17,7 +17,6 @@ import click
17 17
 
18 18
 from monitorstack import utils
19 19
 from monitorstack.cli import pass_context
20
-from monitorstack.utils import os_utils as ost
21 20
 
22 21
 
23 22
 DOC = """Get nova ram quotas."""
@@ -33,6 +32,10 @@ def cli(ctx, config_file):
33 32
     """Get nova ram quotas."""
34 33
     setattr(cli, '__doc__', DOC)
35 34
 
35
+    # Lower level import because we only want to load this module
36
+    # when this plugin is called.
37
+    from monitorstack.utils import os_utils as ost
38
+
36 39
     output = {
37 40
         'measurement_name': COMMAND_NAME,
38 41
         'meta': {

+ 4
- 1
monitorstack/plugins/os_vm_used_cores.py View File

@@ -19,7 +19,6 @@ import click
19 19
 
20 20
 from monitorstack import utils
21 21
 from monitorstack.cli import pass_context
22
-from monitorstack.utils import os_utils as ost
23 22
 
24 23
 
25 24
 DOC = """Get nova used cores."""
@@ -35,6 +34,10 @@ def cli(ctx, config_file):
35 34
     """Get nova used cores."""
36 35
     setattr(cli, '__doc__', DOC)
37 36
 
37
+    # Lower level import because we only want to load this module
38
+    # when this plugin is called.
39
+    from monitorstack.utils import os_utils as ost
40
+
38 41
     output = {
39 42
         'measurement_name': COMMAND_NAME,
40 43
         'meta': {

+ 4
- 1
monitorstack/plugins/os_vm_used_disk.py View File

@@ -19,7 +19,6 @@ import click
19 19
 
20 20
 from monitorstack import utils
21 21
 from monitorstack.cli import pass_context
22
-from monitorstack.utils import os_utils as ost
23 22
 
24 23
 
25 24
 DOC = """Get nova used disk."""
@@ -35,6 +34,10 @@ def cli(ctx, config_file):
35 34
     """Get nova used disk."""
36 35
     setattr(cli, '__doc__', DOC)
37 36
 
37
+    # Lower level import because we only want to load this module
38
+    # when this plugin is called.
39
+    from monitorstack.utils import os_utils as ost
40
+
38 41
     output = {
39 42
         'measurement_name': COMMAND_NAME,
40 43
         'meta': {

+ 4
- 1
monitorstack/plugins/os_vm_used_instance.py View File

@@ -19,7 +19,6 @@ import click
19 19
 
20 20
 from monitorstack import utils
21 21
 from monitorstack.cli import pass_context
22
-from monitorstack.utils import os_utils as ost
23 22
 
24 23
 
25 24
 DOC = """Get nova used instances."""
@@ -35,6 +34,10 @@ def cli(ctx, config_file):
35 34
     """Get nova used instances."""
36 35
     setattr(cli, '__doc__', DOC)
37 36
 
37
+    # Lower level import because we only want to load this module
38
+    # when this plugin is called.
39
+    from monitorstack.utils import os_utils as ost
40
+
38 41
     output = {
39 42
         'measurement_name': COMMAND_NAME,
40 43
         'meta': {

+ 4
- 1
monitorstack/plugins/os_vm_used_ram.py View File

@@ -19,7 +19,6 @@ import click
19 19
 
20 20
 from monitorstack import utils
21 21
 from monitorstack.cli import pass_context
22
-from monitorstack.utils import os_utils as ost
23 22
 
24 23
 
25 24
 DOC = """Get nova used ram."""
@@ -35,6 +34,10 @@ def cli(ctx, config_file):
35 34
     """Get nova used ram."""
36 35
     setattr(cli, '__doc__', DOC)
37 36
 
37
+    # Lower level import because we only want to load this module
38
+    # when this plugin is called.
39
+    from monitorstack.utils import os_utils as ost
40
+
38 41
     output = {
39 42
         'measurement_name': COMMAND_NAME,
40 43
         'meta': {

Loading…
Cancel
Save