python-watcher 14.0.0__py3-none-any.whl → 14.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {python_watcher-14.0.0.dist-info → python_watcher-14.1.0.dist-info}/METADATA +1 -2
  2. {python_watcher-14.0.0.dist-info → python_watcher-14.1.0.dist-info}/RECORD +31 -29
  3. python_watcher-14.1.0.dist-info/pbr.json +1 -0
  4. watcher/api/controllers/v1/audit.py +12 -7
  5. watcher/applier/action_plan/default.py +20 -2
  6. watcher/applier/actions/volume_migration.py +26 -72
  7. watcher/common/keystone_helper.py +0 -34
  8. watcher/common/utils.py +1 -7
  9. watcher/decision_engine/datasources/base.py +1 -1
  10. watcher/decision_engine/datasources/prometheus.py +71 -64
  11. watcher/decision_engine/strategy/strategies/host_maintenance.py +2 -24
  12. watcher/decision_engine/strategy/strategies/zone_migration.py +25 -30
  13. watcher/tests/api/v1/test_audits.py +47 -2
  14. watcher/tests/applier/action_plan/test_default_action_handler.py +27 -0
  15. watcher/tests/applier/actions/test_volume_migration.py +30 -39
  16. watcher/tests/decision_engine/datasources/test_prometheus_helper.py +105 -35
  17. watcher/tests/decision_engine/strategy/strategies/test_host_maintenance.py +8 -5
  18. watcher/tests/decision_engine/strategy/strategies/test_workload_stabilization.py +61 -1
  19. watcher/tests/decision_engine/strategy/strategies/test_zone_migration.py +4 -1
  20. watcher/wsgi/__init__.py +0 -0
  21. watcher/wsgi/api.py +18 -0
  22. python_watcher-14.0.0.dist-info/pbr.json +0 -1
  23. {python_watcher-14.0.0.data → python_watcher-14.1.0.data}/data/etc/apache2/watcher +0 -0
  24. {python_watcher-14.0.0.data → python_watcher-14.1.0.data}/data/etc/watcher/README-watcher.conf.txt +0 -0
  25. {python_watcher-14.0.0.data → python_watcher-14.1.0.data}/data/etc/watcher/oslo-config-generator/watcher.conf +0 -0
  26. {python_watcher-14.0.0.data → python_watcher-14.1.0.data}/data/etc/watcher/oslo-policy-generator/watcher-policy-generator.conf +0 -0
  27. {python_watcher-14.0.0.data → python_watcher-14.1.0.data}/scripts/watcher-api-wsgi +0 -0
  28. {python_watcher-14.0.0.dist-info → python_watcher-14.1.0.dist-info}/AUTHORS +0 -0
  29. {python_watcher-14.0.0.dist-info → python_watcher-14.1.0.dist-info}/LICENSE +0 -0
  30. {python_watcher-14.0.0.dist-info → python_watcher-14.1.0.dist-info}/WHEEL +0 -0
  31. {python_watcher-14.0.0.dist-info → python_watcher-14.1.0.dist-info}/entry_points.txt +0 -0
  32. {python_watcher-14.0.0.dist-info → python_watcher-14.1.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-watcher
3
- Version: 14.0.0
3
+ Version: 14.1.0
4
4
  Summary: OpenStack Watcher provides a flexible and scalable resource optimization service for multi-tenant OpenStack-based clouds.
5
5
  Home-page: https://docs.openstack.org/watcher/latest/
6
6
  Author: OpenStack
@@ -14,7 +14,6 @@ Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: Implementation :: CPython
15
15
  Classifier: Programming Language :: Python :: 3 :: Only
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.9
18
17
  Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
@@ -1,8 +1,8 @@
1
- python_watcher-14.0.0.data/data/etc/apache2/watcher,sha256=urybYUTb0kAVIvbm4WK5oDfXR82QSK2lyMl4Z9dCz4Q,1190
2
- python_watcher-14.0.0.data/data/etc/watcher/README-watcher.conf.txt,sha256=EIa_sjXDyl1XSg0ovsFwUjqw0euS0N2PYn4HtyBGJME,131
3
- python_watcher-14.0.0.data/data/etc/watcher/oslo-config-generator/watcher.conf,sha256=O7g1DZqgXvbQgkBfot0dR1ar1d-3SBkOU_ZK4Dz7SFc,406
4
- python_watcher-14.0.0.data/data/etc/watcher/oslo-policy-generator/watcher-policy-generator.conf,sha256=ZfIuVdtrj7IZm2BrRQvAW3JOL_kqCiILf-vBmwX3ufw,76
5
- python_watcher-14.0.0.data/scripts/watcher-api-wsgi,sha256=YcIpUO3iRVW6Fu3Md_ooAeHkmJJasG031naMdf8cv2A,1829
1
+ python_watcher-14.1.0.data/data/etc/apache2/watcher,sha256=urybYUTb0kAVIvbm4WK5oDfXR82QSK2lyMl4Z9dCz4Q,1190
2
+ python_watcher-14.1.0.data/data/etc/watcher/README-watcher.conf.txt,sha256=EIa_sjXDyl1XSg0ovsFwUjqw0euS0N2PYn4HtyBGJME,131
3
+ python_watcher-14.1.0.data/data/etc/watcher/oslo-config-generator/watcher.conf,sha256=O7g1DZqgXvbQgkBfot0dR1ar1d-3SBkOU_ZK4Dz7SFc,406
4
+ python_watcher-14.1.0.data/data/etc/watcher/oslo-policy-generator/watcher-policy-generator.conf,sha256=ZfIuVdtrj7IZm2BrRQvAW3JOL_kqCiILf-vBmwX3ufw,76
5
+ python_watcher-14.1.0.data/scripts/watcher-api-wsgi,sha256=YcIpUO3iRVW6Fu3Md_ooAeHkmJJasG031naMdf8cv2A,1829
6
6
  watcher/__init__.py,sha256=Vs2olXPZ_IAV1rukHYRl3ITzYFBNXX9mIUtFXkMWYwg,640
7
7
  watcher/_i18n.py,sha256=-25OcpwjDCiYdFIUJh86S7Sg0fs3wMIIjEreaGUyCyY,1295
8
8
  watcher/eventlet.py,sha256=W4qOoDisSJSax28o30p3_w5QRjy_zdE3vNdRUkegXu4,1365
@@ -23,7 +23,7 @@ watcher/api/controllers/root.py,sha256=faobr9kV2C6DiZnRNkJJUuEMym03JP5PawTYrc3Bc
23
23
  watcher/api/controllers/v1/__init__.py,sha256=emVVogtBzsn5bgC_XbVXtgjbYAnvk17R5ueOIonVO0M,10926
24
24
  watcher/api/controllers/v1/action.py,sha256=RCTGt3CA1TEXnAPKQN6aKVC2edQVShwCexZroOhzCkw,16678
25
25
  watcher/api/controllers/v1/action_plan.py,sha256=lPHdza1DZHovrLBGoMhqjeCyQmCL032P2A7R_V7G8D4,23843
26
- watcher/api/controllers/v1/audit.py,sha256=Ra92W3_xHddJm74RtMAQ1n_1D0BXQeWKMBK8v6dWCIY,28020
26
+ watcher/api/controllers/v1/audit.py,sha256=0mXFDRM9OIEN9Wx-kAADYTE6Erh_lkScA3BLstB8wA8,28265
27
27
  watcher/api/controllers/v1/audit_template.py,sha256=VZdjKvbqatO4pcMPn9y9ATXq4I3eP8O9s5ikbOHxNTo,28007
28
28
  watcher/api/controllers/v1/collection.py,sha256=sBsA69y8PrfNzcoZzKax8rD-bf5XWvm-fyw1vsyBJ0E,1756
29
29
  watcher/api/controllers/v1/data_model.py,sha256=bZG6jjM6Atn2UI0MHzOTOvFkAckGsHKDjzIEwQWrhWg,2662
@@ -47,7 +47,7 @@ watcher/applier/rpcapi.py,sha256=77bCwWXa5RMrNMuxre-7Aj-H5A70WHTo6Bj4Pf4ITSM,189
47
47
  watcher/applier/sync.py,sha256=tczQUMw5McbglaDcqehzqzyuhu-UoaFDpsF_KanTOf8,3020
48
48
  watcher/applier/action_plan/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  watcher/applier/action_plan/base.py,sha256=MNhGmeOZJdwmdV4jfJz-jdOOnd5PZah37ahxqmxEKOA,820
50
- watcher/applier/action_plan/default.py,sha256=9CCBoPGPaoQ_uDnbF_ZEHTlKFyzZwSafNUACCtzGStg,4286
50
+ watcher/applier/action_plan/default.py,sha256=5cnAvUqoFE-qerFq-rKY8NAQSwYsE0HoJ7Og5MAmtMQ,5070
51
51
  watcher/applier/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  watcher/applier/actions/base.py,sha256=knuhjKriF6ORRgBz2Uw8lV7s1Ru-6WX0s8gBrHY3QH4,4888
53
53
  watcher/applier/actions/change_node_power_state.py,sha256=RvvlGljFwyIfu-0AwmEKcuikREuN46V9zEfOt387IKI,4274
@@ -57,7 +57,7 @@ watcher/applier/actions/migration.py,sha256=qSCBX7DILKb9f5215THvX29m7xdAMSG3AeNq
57
57
  watcher/applier/actions/nop.py,sha256=GkBGxgHNron_NzM8GK3sDGrBdSZLn4RUJUWaZXmVtTE,1877
58
58
  watcher/applier/actions/resize.py,sha256=J41-YLElaBhUsQsKq9o8pxLyAfw378PgVUMkGN-KUNI,3379
59
59
  watcher/applier/actions/sleep.py,sha256=ZroXYp1-yzVIrpDY-C8coeNdts2b54kWDkRQworDMj4,2024
60
- watcher/applier/actions/volume_migration.py,sha256=-GvmGOcAFOqZo6O94X1FOiFWlGmtWKcJY_ZXk8f5DrE,8523
60
+ watcher/applier/actions/volume_migration.py,sha256=EJ1yifdydE0nQQ0C7XlQKWDVU1F8wtw_BpZRCyGZY28,7317
61
61
  watcher/applier/loading/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  watcher/applier/loading/default.py,sha256=a0xsq266BlNxXXbtQlkszD2QJzHES5nGfmXvlF1GiDs,946
63
63
  watcher/applier/messaging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -79,7 +79,7 @@ watcher/common/config.py,sha256=2_9hklnzAICpZAIDQmxoE8d8qMFS03sjkoVdXPLchmU,1465
79
79
  watcher/common/context.py,sha256=045ss7dk3LU_D-c9jHloMG2YL4CR-EJGXIAfAy9SEs0,4643
80
80
  watcher/common/exception.py,sha256=ww6odr2FwmyffXv7kxoPilKlLuifR_9w8x8Jn1G2xbg,14416
81
81
  watcher/common/ironic_helper.py,sha256=Uw21GnwJHScDPbjiHfou9ZrKIkVF0hgsoVikJBoGPNw,1609
82
- watcher/common/keystone_helper.py,sha256=We6Eu9O021UF2iejtAUhKGLT76dsUGbOWpqjDio4rCE,4485
82
+ watcher/common/keystone_helper.py,sha256=bm9p6YTC-2nv_EY-Grgb57rWA1Dr6tiUljbXocbcb3w,3340
83
83
  watcher/common/nova_helper.py,sha256=kWJr2cUIKiWN4xqcU0XSZX84xf3hhJwEVR01IIS5JfE,29658
84
84
  watcher/common/paths.py,sha256=QIHaSfIR7SExS6ecyqD24iCdkiXIxDk6FopCVF9ijho,1178
85
85
  watcher/common/placement_helper.py,sha256=jo9Ksofh7AGd8rLFsib-cF1kRocP05-trpJOxdM_do0,6652
@@ -88,7 +88,7 @@ watcher/common/rpc.py,sha256=X1ZEohTH6Maw_iZaj9JBDAD_sfUPzV35W4lCeJhRITc,4415
88
88
  watcher/common/scheduling.py,sha256=EDlbXf86tgjzHN_qdTpk_JhfaZI5varD9-meThH7ync,2619
89
89
  watcher/common/service.py,sha256=E7zX4m-nskz-ODbhsKoYhfKHB9-Sbj-FntikvUflFes,9740
90
90
  watcher/common/service_manager.py,sha256=PQwa-58CTLD0bWS_5i9KigSTp9OGeP7m7D1oMg3f50A,1421
91
- watcher/common/utils.py,sha256=Fmq9ynz2QjJcqnJmvS8IdrvBI98Rt_XAYHUMnw-ZXsk,6190
91
+ watcher/common/utils.py,sha256=PCPgzMtVfZR9613P7guKv1DJljK_4e0TbW7LgMXmwcg,6038
92
92
  watcher/common/loader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
93
93
  watcher/common/loader/base.py,sha256=SeI1QVtA11JcQcC8jRxfOraQ9D2WTUdSZv3zAou47Us,842
94
94
  watcher/common/loader/default.py,sha256=P-HZM7wJbQFfNrGSAzZnHj-3t3a6NVx9dQl3dUvawFc,3076
@@ -172,12 +172,12 @@ watcher/decision_engine/audit/continuous.py,sha256=fEIwjqfwcgLo4-6xQAAE3sX2cvgOT
172
172
  watcher/decision_engine/audit/event.py,sha256=TQNiPB806LhrxXtBZMz69qGKOFW2mZZ6zXXv4xoStrk,1049
173
173
  watcher/decision_engine/audit/oneshot.py,sha256=hbcAofXAVEjC5HWJpKq8y1AEKuyFjk33nP1JD5Nc_ps,1046
174
174
  watcher/decision_engine/datasources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
175
- watcher/decision_engine/datasources/base.py,sha256=OXU6GOwYnztZSYwuR8cHII66LviG4Hgs25lr3U2Oubs,9754
175
+ watcher/decision_engine/datasources/base.py,sha256=5hQg6Z7VWsNtyeZEoYxzohtyLBo4IXp_LzI9a4Wz77s,9754
176
176
  watcher/decision_engine/datasources/gnocchi.py,sha256=rKoUFpT-0BeeXEjrfK1A5z-_9cnMyfuonlJh5GplsxQ,10424
177
177
  watcher/decision_engine/datasources/grafana.py,sha256=P6hEsTxwn_ObpOEwMauZOMNrQs9ukdo0bmDlRhDD78o,10279
178
178
  watcher/decision_engine/datasources/manager.py,sha256=nYfc-FeXdkqxr-KInUW_Lefg9y0HCUf0ww8jbcKgVxs,5897
179
179
  watcher/decision_engine/datasources/monasca.py,sha256=rQXBM9MzNP2KBromXxy8MGw8L88nLE9oGjntiam5uvE,6951
180
- watcher/decision_engine/datasources/prometheus.py,sha256=De1yn_2LPJXy2BFx_NPhYD3KHAY6ffaWRMOkDE9pij8,23170
180
+ watcher/decision_engine/datasources/prometheus.py,sha256=quGuG-t-dYWE-pClPBFKUmDDjRLFHr5VPNs2jXWQi2U,23528
181
181
  watcher/decision_engine/datasources/grafana_translator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
182
182
  watcher/decision_engine/datasources/grafana_translator/base.py,sha256=UeiZQeEZXnMg1zlza3mGyoXhLpkU551OzZWetCXjHY4,4554
183
183
  watcher/decision_engine/datasources/grafana_translator/influxdb.py,sha256=22AAs0vFtl6TRd3mbAAURwPemaw8yDiQ56uIuESXRyE,3232
@@ -253,7 +253,7 @@ watcher/decision_engine/strategy/strategies/basic_consolidation.py,sha256=ER4Fx4
253
253
  watcher/decision_engine/strategy/strategies/dummy_strategy.py,sha256=47-R0rrjraE4vytWYcDZ3mtjcO3i0r62dxOqWfb2-5s,2858
254
254
  watcher/decision_engine/strategy/strategies/dummy_with_resize.py,sha256=xEyMmKGw4N74zPp8tB-JEBLaave6IyUNR9EXVL-B4rw,3601
255
255
  watcher/decision_engine/strategy/strategies/dummy_with_scorer.py,sha256=21kfW6iibRbksNKNKHyKEcQs2IpYscXRiZGokbEOl18,6266
256
- watcher/decision_engine/strategy/strategies/host_maintenance.py,sha256=x9Y_mV5ZNJA4_Cvm6HqmPLMY7rhoNL9ufG_fF7-nR9w,11549
256
+ watcher/decision_engine/strategy/strategies/host_maintenance.py,sha256=OWKNOfscT0fj7VwNwnZixziGOsHkif9iquKA-aSXJEg,10558
257
257
  watcher/decision_engine/strategy/strategies/node_resource_consolidation.py,sha256=O69x-Mi1LEb-rJD_NErMONiR2yyKMA4zKgw2s1TXIas,11292
258
258
  watcher/decision_engine/strategy/strategies/noisy_neighbor.py,sha256=OkuAz6yd1N6du-4tVvjDU4VPQb9mBPqejyvra9sCHQ4,9928
259
259
  watcher/decision_engine/strategy/strategies/outlet_temp_control.py,sha256=NaeBhuu45wbBHPArwA9FKNsaBUV7i4nOyzj5Lkq1RLM,11010
@@ -263,7 +263,7 @@ watcher/decision_engine/strategy/strategies/uniform_airflow.py,sha256=MzCCmXirah
263
263
  watcher/decision_engine/strategy/strategies/vm_workload_consolidation.py,sha256=-usWMjqFcbTSWbGKNmsSlZ-0wnMNwLv2w22Fu6nIqyw,27190
264
264
  watcher/decision_engine/strategy/strategies/workload_balance.py,sha256=MMJZkfi8kFJDT4Hcp-NTCclN1MMKj02t88OdMinWYnI,14333
265
265
  watcher/decision_engine/strategy/strategies/workload_stabilization.py,sha256=xKnjDeSAkGxvAuUKlxRGuaHVyBjSy-1nFcgI4ni8pnk,24902
266
- watcher/decision_engine/strategy/strategies/zone_migration.py,sha256=6-b9ofHiAqqr-IBRo8eMDF6NLcs_aZjHdiMgM051HiE,33196
266
+ watcher/decision_engine/strategy/strategies/zone_migration.py,sha256=Dt82_SkERBm-GyoGxsdS4cAFlzUQjGEMEoE9x_5B_hE,32798
267
267
  watcher/hacking/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
268
268
  watcher/hacking/checks.py,sha256=D-PG1fgVyU5TIKVmZcJ0CXbmLx-8_ivU5vCKQvtZkjk,10383
269
269
  watcher/locale/de/LC_MESSAGES/watcher.po,sha256=vOjcLhUBkLGDZ2Q5kM4e4SqlNuS_LY8zXgX9Ib4aPDA,26447
@@ -311,7 +311,7 @@ watcher/tests/api/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
311
311
  watcher/tests/api/v1/test_actions.py,sha256=i84GK1d4wCXqGNXKB5NKbIe45RBSnniLXtgmiXpNbX4,23465
312
312
  watcher/tests/api/v1/test_actions_plans.py,sha256=UtVX1Q6ehnFbHZho3XZk-XNb3vYdJfhlvm94aupToF8,29928
313
313
  watcher/tests/api/v1/test_audit_templates.py,sha256=cxEO9qURC5sUqC5jV1_jDB5N3sqhZ5gINJDF-WkYi78,38364
314
- watcher/tests/api/v1/test_audits.py,sha256=jCB-9wb-xNFScQw4DhG81cl-Ao807W8VrCbaVDA7ykU,49595
314
+ watcher/tests/api/v1/test_audits.py,sha256=5fy4k4NcW-2RGIl0P6eIx1tEdssvvxphBe54VR2PQS8,51712
315
315
  watcher/tests/api/v1/test_data_model.py,sha256=QYPa96qrotEN4hIWLe0tELTWyJ3SZxgBFbOd1EuV-6M,3251
316
316
  watcher/tests/api/v1/test_goals.py,sha256=vveUL0rQHv0LV9xa1T4EQCNpyAbdQMFF14_HHKsyHUs,7335
317
317
  watcher/tests/api/v1/test_microversions.py,sha256=0Oo_AZqg-Mvmc5GGVvIPkWvr2Czl1ku4tUPlEh8WclE,4998
@@ -327,14 +327,14 @@ watcher/tests/applier/test_applier_manager.py,sha256=jA3nHJuXeIEg_nkbX86az4wjyns
327
327
  watcher/tests/applier/test_rpcapi.py,sha256=w4tgzctgN3j3373CTfwWLG4MXI_y6wdUW5GNv-GK41w,1968
328
328
  watcher/tests/applier/test_sync.py,sha256=eUdJ5eIQZunXxpdgFfE6cpSNYisO34w-mFxdB4BGsCY,3402
329
329
  watcher/tests/applier/action_plan/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
330
- watcher/tests/applier/action_plan/test_default_action_handler.py,sha256=hFS2Q9IuoAygHfHHCfabnABkdOXKPKhCPVCImCU0eFQ,5488
330
+ watcher/tests/applier/action_plan/test_default_action_handler.py,sha256=b45C14bZIveTgLnFpJtmoqZVFI7JA6HWnMtpJzU6AyU,6823
331
331
  watcher/tests/applier/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
332
332
  watcher/tests/applier/actions/test_change_node_power_state.py,sha256=NqZIXKgxh810A9vzCj55qyjzcxIiE77T6WYZyLWOynE,6251
333
333
  watcher/tests/applier/actions/test_change_nova_service_state.py,sha256=DnA-nUo4p7ets3dCpUY0TTCi9f8lUO2TfUS1-tMaX3Q,5154
334
334
  watcher/tests/applier/actions/test_migration.py,sha256=_1squ_q5oZVRFtl3y7WLbFUFOGVjkL2CXR5Ayy2tSsk,8654
335
335
  watcher/tests/applier/actions/test_resize.py,sha256=L0fV24QS7sAibgVh5WmwIpywby3RKcjFEu6yQYBA7o8,3470
336
336
  watcher/tests/applier/actions/test_sleep.py,sha256=P5arZUQvFHQwjv739QogQ6kRAIXPHnbDJqAs68VaBas,1637
337
- watcher/tests/applier/actions/test_volume_migration.py,sha256=o5EwWIrSmsnVwn3bd43ec6JFvopycOQwMLDioIFGeH0,8973
337
+ watcher/tests/applier/actions/test_volume_migration.py,sha256=gw6rWRWoP09gF1-BCHjCfakSc_Yq5hLbcsOr1h3gyIw,8639
338
338
  watcher/tests/applier/actions/loading/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
339
339
  watcher/tests/applier/actions/loading/test_default_actions_loader.py,sha256=p590vgsqMz1wwXnXHNruIAO0APqFV6IMtqajo4fPT_E,1109
340
340
  watcher/tests/applier/messaging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -402,7 +402,7 @@ watcher/tests/decision_engine/datasources/test_gnocchi_helper.py,sha256=CqvO0wcv
402
402
  watcher/tests/decision_engine/datasources/test_grafana_helper.py,sha256=NVGVlzjAtxOaJLL-1s1V0jETAc5_2QP0Hr0qb4TiEn0,11858
403
403
  watcher/tests/decision_engine/datasources/test_manager.py,sha256=v4P-toK9d-I6TbpTwNtqStufS81Yks65vg6u7I6fYLc,6763
404
404
  watcher/tests/decision_engine/datasources/test_monasca_helper.py,sha256=toxxJCRCDgjvnN3wAXzdi6MPOCeMpKRikzXtcg-Oq0k,5697
405
- watcher/tests/decision_engine/datasources/test_prometheus_helper.py,sha256=eJQVYWk72Z6DYqBAuDkYESf71GMMcTGL_neRzGaPuvc,28297
405
+ watcher/tests/decision_engine/datasources/test_prometheus_helper.py,sha256=ecPDFdbSi1i3KhJVDxTbVxZSwoRPsazUkAsrOspXIko,31425
406
406
  watcher/tests/decision_engine/datasources/grafana_translators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
407
407
  watcher/tests/decision_engine/datasources/grafana_translators/test_base.py,sha256=vuQ5v73ulGgHu75RSkLs-syTAOefnOUAbD4NlbX4EsY,3694
408
408
  watcher/tests/decision_engine/datasources/grafana_translators/test_influxdb.py,sha256=swWkFSu6WbBpujvYVxmiP-E5ClLg8U2NetqEtOdqTVI,5816
@@ -514,7 +514,7 @@ watcher/tests/decision_engine/strategy/strategies/test_base.py,sha256=cRzQiGn3nQ
514
514
  watcher/tests/decision_engine/strategy/strategies/test_basic_consolidation.py,sha256=tWIDFzsxch2J2jTEjX4qJP5jlakeguIntLNkHO9zcF8,9804
515
515
  watcher/tests/decision_engine/strategy/strategies/test_dummy_strategy.py,sha256=Y5hL5lvYjNIF7l42tKtGzFSo-OqkQTv4lPBp2bV-o4g,1936
516
516
  watcher/tests/decision_engine/strategy/strategies/test_dummy_with_scorer.py,sha256=8HKXe57vFBxeq2Uy_YVHG9AwEI8HqLtwPQ4Hvt7CESM,1951
517
- watcher/tests/decision_engine/strategy/strategies/test_host_maintenance.py,sha256=FZQEH0sP4kV3O233grxobcnrDbOVYkBm_IXD23CCzck,10284
517
+ watcher/tests/decision_engine/strategy/strategies/test_host_maintenance.py,sha256=aAOEkn2gTRGTdURB99fMGxMxHZgq7rJ-EAWlG4Z4oow,10485
518
518
  watcher/tests/decision_engine/strategy/strategies/test_node_resource_consolidation.py,sha256=kyvyxJyrj_ArJsuoIDpOWDn-Ek-gkKlNxlYF3bDt4MA,15906
519
519
  watcher/tests/decision_engine/strategy/strategies/test_noisy_neighbor.py,sha256=RFAZiFHufHVRAXvIQdgZ5RkXXV23Ui7HezqDPCRYZoI,5400
520
520
  watcher/tests/decision_engine/strategy/strategies/test_outlet_temp_control.py,sha256=VHn0DNCunf_Wg2RX1QXQcTAtPauYn_aP1VPrc0DKd34,4697
@@ -524,8 +524,8 @@ watcher/tests/decision_engine/strategy/strategies/test_strategy_endpoint.py,sha2
524
524
  watcher/tests/decision_engine/strategy/strategies/test_uniform_airflow.py,sha256=ChNt74enUScPZFFrDLa9Xqnq4O1nU2CAg7KnyNl3JOM,7265
525
525
  watcher/tests/decision_engine/strategy/strategies/test_vm_workload_consolidation.py,sha256=AXY55dBg_8w37qpy0BT89ScUo81BUCZXwZO957jTgEE,19203
526
526
  watcher/tests/decision_engine/strategy/strategies/test_workload_balance.py,sha256=utqnw1rUNTFfdBhuNsxY8Q81Lr7SNhfYSyHCVxUL-BA,6074
527
- watcher/tests/decision_engine/strategy/strategies/test_workload_stabilization.py,sha256=rVhGyeyuOd8hXG3rzPhnNkg39j0atxC2_sf_KT_O7i8,11802
528
- watcher/tests/decision_engine/strategy/strategies/test_zone_migration.py,sha256=sFT-q3uYwNIqCgcFmzDbB_aPcqRyJUFQjCV97yK_xGY,30721
527
+ watcher/tests/decision_engine/strategy/strategies/test_workload_stabilization.py,sha256=eGr_PX8dpM4oTlC-GFrimDN1kQbKpNFzA_C5c4mo250,14313
528
+ watcher/tests/decision_engine/strategy/strategies/test_zone_migration.py,sha256=eEkK66H_nnhghDEuBXo8dvdifhN6N_9CO5mlVdN-ytM,30871
529
529
  watcher/tests/notifications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
530
530
  watcher/tests/notifications/test_action_notification.py,sha256=sR7ES_GhCdUUY3a6S2ta8imRQ69r2yMEX78QngxfHSA,22457
531
531
  watcher/tests/notifications/test_action_plan_notification.py,sha256=vSr04aG3XsitWvu_nEFttBwqrJDzCnfUIjQrVdb0c9w,28848
@@ -545,11 +545,13 @@ watcher/tests/objects/test_scoring_engine.py,sha256=sF0UljIG_KZYCr9GshHdqaXThjNh
545
545
  watcher/tests/objects/test_service.py,sha256=V5yA7Z65D8cMMs4VC5mbYoFQiamVyczIjffEk4Yo5b0,5124
546
546
  watcher/tests/objects/test_strategy.py,sha256=WoJYFQD0LU7vkUT2MMy1bx3S6eY458aTICjoGRiPccI,7364
547
547
  watcher/tests/objects/utils.py,sha256=WtBFlXWIBRvl1keAjz1GtrkUWppil2pFIA-RngcqA5c,8058
548
- python_watcher-14.0.0.dist-info/AUTHORS,sha256=9d2KSouBWGvHRnwW5J5wzVLYye0DXA0miYTgIytR-X0,7961
549
- python_watcher-14.0.0.dist-info/LICENSE,sha256=XfKg2H1sVi8OoRxoisUlMqoo10TKvHmU_wU39ks7MyA,10143
550
- python_watcher-14.0.0.dist-info/METADATA,sha256=GORpCfnwg2lvLTee-dYPesw-tExI7_l_KAHvMTKUOEY,3930
551
- python_watcher-14.0.0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
552
- python_watcher-14.0.0.dist-info/entry_points.txt,sha256=PN53WKewBT3McXxlv--kAOX-3NWeJqYVy8wkeCR0orc,4396
553
- python_watcher-14.0.0.dist-info/pbr.json,sha256=EKRQ_-nw3peY5gQBMh-ZrgHMNiJoesllEZKaiR78E4Y,47
554
- python_watcher-14.0.0.dist-info/top_level.txt,sha256=O2B7Sbzshq5s-tZxb2a7VETvMDiJItSYieAiJ6Jm5yY,8
555
- python_watcher-14.0.0.dist-info/RECORD,,
548
+ watcher/wsgi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
549
+ watcher/wsgi/api.py,sha256=F1s1Q_CMuRdgS_f7Gl3XzavjZqdxqO9IHLxSWl6NOO4,789
550
+ python_watcher-14.1.0.dist-info/AUTHORS,sha256=9d2KSouBWGvHRnwW5J5wzVLYye0DXA0miYTgIytR-X0,7961
551
+ python_watcher-14.1.0.dist-info/LICENSE,sha256=XfKg2H1sVi8OoRxoisUlMqoo10TKvHmU_wU39ks7MyA,10143
552
+ python_watcher-14.1.0.dist-info/METADATA,sha256=bpNI_tPLjPM568PVe3YLFl8uXnDwDhDB-vs_ywg8iOQ,3880
553
+ python_watcher-14.1.0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
554
+ python_watcher-14.1.0.dist-info/entry_points.txt,sha256=PN53WKewBT3McXxlv--kAOX-3NWeJqYVy8wkeCR0orc,4396
555
+ python_watcher-14.1.0.dist-info/pbr.json,sha256=VdP5H0whv1sbxfhXfL9UYnztLRuOH2xlRrkMU-YtJfk,47
556
+ python_watcher-14.1.0.dist-info/top_level.txt,sha256=O2B7Sbzshq5s-tZxb2a7VETvMDiJItSYieAiJ6Jm5yY,8
557
+ python_watcher-14.1.0.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ {"git_version": "024815af", "is_release": true}
@@ -33,6 +33,7 @@ import datetime
33
33
  from dateutil import tz
34
34
 
35
35
  from http import HTTPStatus
36
+ import jsonschema
36
37
  from oslo_log import log
37
38
  from oslo_utils import timeutils
38
39
  import pecan
@@ -114,6 +115,11 @@ class AuditPostType(wtypes.Base):
114
115
  if self.audit_type not in audit_type_values:
115
116
  raise exception.AuditTypeNotFound(audit_type=self.audit_type)
116
117
 
118
+ if not self.audit_template_uuid and not self.goal:
119
+ message = _(
120
+ 'A valid goal or audit_template_id must be provided')
121
+ raise exception.Invalid(message)
122
+
117
123
  if (self.audit_type == objects.audit.AuditType.ONESHOT.value and
118
124
  self.interval not in (wtypes.Unset, None)):
119
125
  raise exception.AuditIntervalNotAllowed(audit_type=self.audit_type)
@@ -612,11 +618,6 @@ class AuditsController(rest.RestController):
612
618
  if self.from_audits:
613
619
  raise exception.OperationNotPermitted
614
620
 
615
- if not audit._goal_uuid:
616
- raise exception.Invalid(
617
- message=_('A valid goal_id or audit_template_id '
618
- 'must be provided'))
619
-
620
621
  strategy_uuid = audit.strategy_uuid
621
622
  no_schema = True
622
623
  if strategy_uuid is not None:
@@ -627,8 +628,12 @@ class AuditsController(rest.RestController):
627
628
  if schema:
628
629
  # validate input parameter with default value feedback
629
630
  no_schema = False
630
- utils.StrictDefaultValidatingDraft4Validator(schema).validate(
631
- audit.parameters)
631
+ try:
632
+ utils.StrictDefaultValidatingDraft4Validator(
633
+ schema).validate(audit.parameters)
634
+ except jsonschema.exceptions.ValidationError as e:
635
+ raise exception.Invalid(
636
+ _('Invalid parameters for strategy: %s') % e)
632
637
 
633
638
  if no_schema and audit.parameters:
634
639
  raise exception.Invalid(_('Specify parameters but no predefined '
@@ -56,12 +56,30 @@ class DefaultActionPlanHandler(base.BaseActionPlanHandler):
56
56
  applier = default.DefaultApplier(self.ctx, self.service)
57
57
  applier.execute(self.action_plan_uuid)
58
58
 
59
- action_plan.state = objects.action_plan.State.SUCCEEDED
59
+ # If any action has failed the action plan should be FAILED
60
+ # Define default values for successful execution
61
+ ap_state = objects.action_plan.State.SUCCEEDED
62
+ notification_kwargs = {
63
+ 'phase': fields.NotificationPhase.END
64
+ }
65
+
66
+ failed_filter = {'action_plan_uuid': self.action_plan_uuid,
67
+ 'state': objects.action.State.FAILED}
68
+ failed_actions = objects.Action.list(
69
+ self.ctx, filters=failed_filter, eager=True)
70
+ if failed_actions:
71
+ ap_state = objects.action_plan.State.FAILED
72
+ notification_kwargs = {
73
+ 'phase': fields.NotificationPhase.ERROR,
74
+ 'priority': fields.NotificationPriority.ERROR
75
+ }
76
+
77
+ action_plan.state = ap_state
60
78
  action_plan.save()
61
79
  notifications.action_plan.send_action_notification(
62
80
  self.ctx, action_plan,
63
81
  action=fields.NotificationAction.EXECUTION,
64
- phase=fields.NotificationPhase.END)
82
+ **notification_kwargs)
65
83
 
66
84
  except exception.ActionPlanCancelled as e:
67
85
  LOG.exception(e)
@@ -17,14 +17,11 @@ import jsonschema
17
17
 
18
18
  from oslo_log import log
19
19
 
20
- from cinderclient import client as cinder_client
21
20
  from watcher._i18n import _
22
21
  from watcher.applier.actions import base
23
22
  from watcher.common import cinder_helper
24
23
  from watcher.common import exception
25
- from watcher.common import keystone_helper
26
24
  from watcher.common import nova_helper
27
- from watcher.common import utils
28
25
  from watcher import conf
29
26
 
30
27
  CONF = conf.CONF
@@ -70,8 +67,6 @@ class VolumeMigrate(base.BaseAction):
70
67
 
71
68
  def __init__(self, config, osc=None):
72
69
  super(VolumeMigrate, self).__init__(config)
73
- self.temp_username = utils.random_string(10)
74
- self.temp_password = utils.random_string(10)
75
70
  self.cinder_util = cinder_helper.CinderHelper(osc=self.osc)
76
71
  self.nova_util = nova_helper.NovaHelper(osc=self.osc)
77
72
 
@@ -134,83 +129,42 @@ class VolumeMigrate(base.BaseAction):
134
129
 
135
130
  def _can_swap(self, volume):
136
131
  """Judge volume can be swapped"""
132
+ # TODO(sean-k-mooney): rename this to _can_migrate and update
133
+ # tests to reflect that.
137
134
 
135
+ # cinder volume migration can migrate volumes that are not
136
+ # attached to instances or nova can migrate the data for cinder
137
+ # if the volume is in-use. If the volume has no attachments
138
+ # allow cinder to decided if it can be migrated.
138
139
  if not volume.attachments:
139
- return False
140
- instance_id = volume.attachments[0]['server_id']
141
- instance_status = self.nova_util.find_instance(instance_id).status
142
-
143
- if (volume.status == 'in-use' and
144
- instance_status in ('ACTIVE', 'PAUSED', 'RESIZED')):
140
+ LOG.debug(f"volume: {volume.id} has no attachments")
145
141
  return True
146
142
 
147
- return False
148
-
149
- def _create_user(self, volume, user):
150
- """Create user with volume attribute and user information"""
151
- keystone_util = keystone_helper.KeystoneHelper(osc=self.osc)
152
- project_id = getattr(volume, 'os-vol-tenant-attr:tenant_id')
153
- user['project'] = project_id
154
- user['domain'] = keystone_util.get_project(project_id).domain_id
155
- user['roles'] = ['admin']
156
- return keystone_util.create_user(user)
157
-
158
- def _get_cinder_client(self, session):
159
- """Get cinder client by session"""
160
- return cinder_client.Client(
161
- CONF.cinder_client.api_version,
162
- session=session,
163
- endpoint_type=CONF.cinder_client.endpoint_type)
164
-
165
- def _swap_volume(self, volume, dest_type):
166
- """Swap volume to dest_type
167
-
168
- Limitation note: only for compute libvirt driver
169
- """
170
- if not dest_type:
171
- raise exception.Invalid(
172
- message=(_("destination type is required when "
173
- "migration type is swap")))
174
-
175
- if not self._can_swap(volume):
176
- raise exception.Invalid(
177
- message=(_("Invalid state for swapping volume")))
178
-
179
- user_info = {
180
- 'name': self.temp_username,
181
- 'password': self.temp_password}
182
- user = self._create_user(volume, user_info)
183
- keystone_util = keystone_helper.KeystoneHelper(osc=self.osc)
184
- try:
185
- session = keystone_util.create_session(
186
- user.id, self.temp_password)
187
- temp_cinder = self._get_cinder_client(session)
188
-
189
- # swap volume
190
- new_volume = self.cinder_util.create_volume(
191
- temp_cinder, volume, dest_type)
192
- self.nova_util.swap_volume(volume, new_volume)
193
-
194
- # delete old volume
195
- self.cinder_util.delete_volume(volume)
196
-
197
- finally:
198
- keystone_util.delete_user(user)
199
-
200
- return True
143
+ # since it has attachments we need to validate nova's constraints
144
+ instance_id = volume.attachments[0]['server_id']
145
+ instance_status = self.nova_util.find_instance(instance_id).status
146
+ LOG.debug(
147
+ f"volume: {volume.id} is attached to instance: {instance_id} "
148
+ f"in instance status: {instance_status}")
149
+ # NOTE(sean-k-mooney): This used to allow RESIZED which
150
+ # is the resize_verify task state, that is not an acceptable time
151
+ # to migrate volumes, if nova does not block this in the API
152
+ # today that is probably a bug. PAUSED is also questionable but
153
+ # it should generally be safe.
154
+ return (volume.status == 'in-use' and
155
+ instance_status in ('ACTIVE', 'PAUSED'))
201
156
 
202
157
  def _migrate(self, volume_id, dest_node, dest_type):
203
-
204
158
  try:
205
159
  volume = self.cinder_util.get_volume(volume_id)
206
- if self.migration_type == self.SWAP:
207
- if dest_node:
208
- LOG.warning("dest_node is ignored")
209
- return self._swap_volume(volume, dest_type)
160
+ # for backward compatibility map swap to migrate.
161
+ if self.migration_type in (self.SWAP, self.MIGRATE):
162
+ if not self._can_swap(volume):
163
+ raise exception.Invalid(
164
+ message=(_("Invalid state for swapping volume")))
165
+ return self.cinder_util.migrate(volume, dest_node)
210
166
  elif self.migration_type == self.RETYPE:
211
167
  return self.cinder_util.retype(volume, dest_type)
212
- elif self.migration_type == self.MIGRATE:
213
- return self.cinder_util.migrate(volume, dest_node)
214
168
  else:
215
169
  raise exception.Invalid(
216
170
  message=(_("Migration of type '%(migration_type)s' is not "
@@ -15,8 +15,6 @@
15
15
  from oslo_log import log
16
16
 
17
17
  from keystoneauth1.exceptions import http as ks_exceptions
18
- from keystoneauth1 import loading
19
- from keystoneauth1 import session
20
18
  from watcher._i18n import _
21
19
  from watcher.common import clients
22
20
  from watcher.common import exception
@@ -90,35 +88,3 @@ class KeystoneHelper(object):
90
88
  message=(_("Domain name seems ambiguous: %s") %
91
89
  name_or_id))
92
90
  return domains[0]
93
-
94
- def create_session(self, user_id, password):
95
- user = self.get_user(user_id)
96
- loader = loading.get_plugin_loader('password')
97
- auth = loader.load_from_options(
98
- auth_url=CONF.watcher_clients_auth.auth_url,
99
- password=password,
100
- user_id=user_id,
101
- project_id=user.default_project_id)
102
- return session.Session(auth=auth)
103
-
104
- def create_user(self, user):
105
- project = self.get_project(user['project'])
106
- domain = self.get_domain(user['domain'])
107
- _user = self.keystone.users.create(
108
- user['name'],
109
- password=user['password'],
110
- domain=domain,
111
- project=project,
112
- )
113
- for role in user['roles']:
114
- role = self.get_role(role)
115
- self.keystone.roles.grant(
116
- role.id, user=_user.id, project=project.id)
117
- return _user
118
-
119
- def delete_user(self, user):
120
- try:
121
- user = self.get_user(user)
122
- self.keystone.users.delete(user)
123
- except exception.Invalid:
124
- pass
watcher/common/utils.py CHANGED
@@ -19,9 +19,7 @@
19
19
  import asyncio
20
20
  import datetime
21
21
  import inspect
22
- import random
23
22
  import re
24
- import string
25
23
 
26
24
  from croniter import croniter
27
25
  import eventlet
@@ -160,12 +158,8 @@ def extend_with_strict_schema(validator_class):
160
158
  StrictDefaultValidatingDraft4Validator = extend_with_default(
161
159
  extend_with_strict_schema(validators.Draft4Validator))
162
160
 
163
- Draft4Validator = validators.Draft4Validator
164
-
165
161
 
166
- def random_string(n):
167
- return ''.join([random.choice(
168
- string.ascii_letters + string.digits) for i in range(n)])
162
+ Draft4Validator = validators.Draft4Validator
169
163
 
170
164
 
171
165
  # Some clients (e.g. MAAS) use asyncio, which isn't compatible with Eventlet.
@@ -178,7 +178,7 @@ class DataSourceBase(object):
178
178
  granularity=None):
179
179
  """Get the ram usage for a host such as a compute_node
180
180
 
181
- :return: ram usage as float in megabytes
181
+ :return: ram usage as float in kibibytes
182
182
  """
183
183
  pass
184
184