Browse Source

Deprecate 'novaclient.client.get_client_class'

This method is redundant and blocks versioned client classes to change
interface. `novaclient.client.Client` should be used instead.

Releated-Bug: #1493576
Change-Id: I73cea2c6062419d75646e9239c6194f4d1ffd2b1
tags/2.29.0
Andrey Kurilin 4 years ago
parent
commit
147a1a6ee4
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      novaclient/client.py

+ 4
- 1
novaclient/client.py View File

@@ -30,6 +30,7 @@ import logging
30 30
 import os
31 31
 import pkgutil
32 32
 import re
33
+import warnings
33 34
 
34 35
 from keystoneclient import adapter
35 36
 from keystoneclient import session
@@ -48,7 +49,7 @@ from six.moves.urllib import parse
48 49
 from novaclient import api_versions
49 50
 from novaclient import exceptions
50 51
 from novaclient import extension as ext
51
-from novaclient.i18n import _
52
+from novaclient.i18n import _, _LW
52 53
 from novaclient import service_catalog
53 54
 from novaclient import utils
54 55
 
@@ -780,6 +781,8 @@ def _get_client_class_and_version(version):
780 781
 
781 782
 def get_client_class(version):
782 783
     """Returns Client class based on given version."""
784
+    warnings.warn(_LW("'get_client_class' is deprecated. "
785
+                      "Please use `novaclient.client.Client` instead."))
783 786
     _api_version, client_class = _get_client_class_and_version(version)
784 787
     return client_class
785 788
 

Loading…
Cancel
Save