python-blazarclient 4.1.0__py3-none-any.whl → 4.2.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.
@@ -28,7 +28,7 @@ FIRST_LEASE = 'd1e43d6d-8f6f-4c2e-b0a9-2982b39dc698'
28
28
  SECOND_LEASE = '424d21c3-45a2-448a-81ad-32eddc888375'
29
29
 
30
30
 
31
- @mock.patch('blazarclient.v1.shell_commands.leases._utc_now', mock_time)
31
+ @mock.patch('oslo_utils.timeutils.utcnow', mock_time)
32
32
  class CreateLeaseTestCase(tests.TestCase):
33
33
 
34
34
  def setUp(self):
blazarclient/utils.py CHANGED
@@ -22,7 +22,7 @@ from oslo_serialization import jsonutils as json
22
22
  from blazarclient import exception
23
23
  from blazarclient.i18n import _
24
24
 
25
- ELAPSED_TIME_REGEX = '^(\d+)([s|m|h|d])$' # noqa W605
25
+ ELAPSED_TIME_REGEX = r'^(\d+)([s|m|h|d])$'
26
26
 
27
27
  LEASE_DATE_FORMAT = '%Y-%m-%dT%H:%M:%S.%f'
28
28
  API_DATE_FORMAT = '%Y-%m-%d %H:%M'
@@ -20,6 +20,7 @@ import re
20
20
 
21
21
  from oslo_serialization import jsonutils
22
22
  from oslo_utils import strutils
23
+ from oslo_utils import timeutils
23
24
 
24
25
  from blazarclient import command
25
26
  from blazarclient import exception
@@ -64,16 +65,6 @@ CREATE_RESERVATION_KEYS = {
64
65
  }
65
66
 
66
67
 
67
- def _utc_now():
68
- """Wrap datetime.datetime.utcnow so it can be mocked in unit tests.
69
-
70
- This is required because some of the tests require understanding the
71
- 'current time'; simply mocking utcnow() is made very difficult by
72
- the many different ways the datetime package is used in this module.
73
- """
74
- return datetime.datetime.utcnow()
75
-
76
-
77
68
  class ListLeases(command.ListCommand):
78
69
  """Print a list of leases."""
79
70
  resource = 'lease'
@@ -113,7 +104,7 @@ class CreateLeaseBase(command.CreateCommand):
113
104
  json_indent = 4
114
105
  log = logging.getLogger(__name__ + '.CreateLease')
115
106
  default_start = 'now'
116
- default_end = _utc_now() + datetime.timedelta(days=1)
107
+ default_end = timeutils.utcnow() + datetime.timedelta(days=1)
117
108
 
118
109
  def get_parser(self, prog_name):
119
110
  parser = super(CreateLeaseBase, self).get_parser(prog_name)
@@ -189,7 +180,7 @@ class CreateLeaseBase(command.CreateCommand):
189
180
  raise exception.IncorrectLease
190
181
 
191
182
  if parsed_args.start == 'now':
192
- start = _utc_now()
183
+ start = timeutils.utcnow()
193
184
  else:
194
185
  start = parsed_args.start
195
186
 
@@ -39,8 +39,10 @@ Sergey Lukjanov <slukjanov@mirantis.com>
39
39
  ShangXiao <shangxiaobj@inspur.com>
40
40
  Steve Martinelli <s.martinelli@gmail.com>
41
41
  Sylvain Bauza <sylvain.bauza@bull.net>
42
+ Takashi Natsume <takanattie@gmail.com>
42
43
  Tetsuro Nakamura <nakamura.tetsuro@lab.ntt.co.jp>
43
44
  Tetsuro Nakamura <tetsuro.nakamura.bc@hco.ntt.co.jp>
45
+ Thomas Goirand <zigo@debian.org>
44
46
  Tony Breeds <tony@bakeyournoodle.com>
45
47
  Vieri <15050873171@163.com>
46
48
  ZhijunWei <wzj334965317@outlook.com>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-blazarclient
3
- Version: 4.1.0
3
+ Version: 4.2.0
4
4
  Summary: Client for OpenStack Reservation Service
5
5
  Home-page: https://launchpad.net/blazar
6
6
  Author: OpenStack
@@ -29,7 +29,7 @@ Requires-Dist: keystoneauth1 (>=3.4.0)
29
29
  Requires-Dist: osc-lib (>=1.3.0)
30
30
  Requires-Dist: oslo.i18n (>=3.15.3)
31
31
  Requires-Dist: oslo.log (>=3.36.0)
32
- Requires-Dist: oslo.utils (>=3.33.0)
32
+ Requires-Dist: oslo.utils (>=7.0.0)
33
33
  Requires-Dist: pbr (!=2.1.0,>=2.0.0)
34
34
 
35
35
  ========================
@@ -5,7 +5,7 @@ blazarclient/command.py,sha256=m-Tek-l_1Xy3YZND5_f-9Ia8HiT3uCYxKIaCzHG1WOA,12448
5
5
  blazarclient/exception.py,sha256=nccQagxyp1wkgFSAxacbWXl6vdqvy0Q92jeW4TVL4mQ,3080
6
6
  blazarclient/i18n.py,sha256=xH89lr9tMpr9WQelTfqbjJJldqcxvDOLOgEJj6AjkFg,857
7
7
  blazarclient/shell.py,sha256=hD6db_wwQnz6cxNSmOv2E0SfehnQy9_LscBpyY7uoRo,13986
8
- blazarclient/utils.py,sha256=PHqygiKPlXW1eSvIbr5ASP1egfdyHfBZ9wYxpQD3oSg,5999
8
+ blazarclient/utils.py,sha256=HOjSVBFIV6ytewIUSWeS3OMxnC1czbIO5REijh563vM,5988
9
9
  blazarclient/version.py,sha256=r2fTZKJSyMU6-NtpZpGXVk3ZXkeNGtxQp06S-ajsgV0,682
10
10
  blazarclient/osc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  blazarclient/osc/plugin.py,sha256=1DcRdrjsEg5xata7iFanLFR8c2GTbnP5H1AgKv4pKNc,2120
@@ -19,7 +19,7 @@ blazarclient/tests/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
19
19
  blazarclient/tests/v1/shell_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  blazarclient/tests/v1/shell_commands/test_floatingips.py,sha256=7YRS34Q0FFuOvj18igKeimF6tuM96YO1hDDcR0ZkNlw,4920
21
21
  blazarclient/tests/v1/shell_commands/test_hosts.py,sha256=ChUgCTSwj_YjddIx9uZSPRVm0lQxTrA-KtnqllZUzgA,8026
22
- blazarclient/tests/v1/shell_commands/test_leases.py,sha256=3bLxmcJKi_phsln9fwiugll_3XufUTiTbu_g93OnzXc,13166
22
+ blazarclient/tests/v1/shell_commands/test_leases.py,sha256=0GbULeNp0tVRCYz7fa0IQwvGi_ZkQaD6Kn-4JAeVP54,13147
23
23
  blazarclient/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  blazarclient/v1/allocations.py,sha256=NtA3zv-J9EgS6OrcG2XoqiJC5pVJZ1WI45CH3wsuHNI,1339
25
25
  blazarclient/v1/client.py,sha256=xTdnTA5hXT_3da6_ZYtC2HY4bHfUTY_1mBvQAHFfF_0,2719
@@ -30,12 +30,12 @@ blazarclient/v1/shell_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
30
30
  blazarclient/v1/shell_commands/allocations.py,sha256=r92zczR04SFe5Dr-hxBwpajpVXP6pP-7cUk9yIDTmME,5222
31
31
  blazarclient/v1/shell_commands/floatingips.py,sha256=x9Ygy_-oysFntIk3Qb9bG3U236S_JPFMjb5I3CwDlIU,2905
32
32
  blazarclient/v1/shell_commands/hosts.py,sha256=Mg7ZmnaFla8mLFTf5LVr_BuSTva-O6vnXLF8c3awQKU,6533
33
- blazarclient/v1/shell_commands/leases.py,sha256=KtocljZRXzKlq6h-VQXQlEbo4kluRdefRuEASJUefFc,19066
34
- python_blazarclient-4.1.0.dist-info/AUTHORS,sha256=Gl9UjhCtshkJSM9Iq-85g6NhrvjLJIkFGojEW_vfHYg,2420
35
- python_blazarclient-4.1.0.dist-info/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
36
- python_blazarclient-4.1.0.dist-info/METADATA,sha256=YcignKhBgLsJxMOeIy3Eq24mpLcaXJNitcIrhlugl9Y,2341
37
- python_blazarclient-4.1.0.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
38
- python_blazarclient-4.1.0.dist-info/entry_points.txt,sha256=GeegiiG8GncGF7f6jonugjHhqNEYVaWe6TbYLhyhPWk,1687
39
- python_blazarclient-4.1.0.dist-info/pbr.json,sha256=UVLUJJGXJAvgIj53ZPvvsKI6IKwps5cUNwpcNVX5fDo,46
40
- python_blazarclient-4.1.0.dist-info/top_level.txt,sha256=yQx5ICRTYACa8B3aVm1rnJI6miXR0odH3BkwmoKD-0E,13
41
- python_blazarclient-4.1.0.dist-info/RECORD,,
33
+ blazarclient/v1/shell_commands/leases.py,sha256=P0KTucuTJibGbl14W9eU7IdtIFotfJM9wVL8bWNp88w,18762
34
+ python_blazarclient-4.2.0.dist-info/AUTHORS,sha256=DntWJBcJ5OK-o_id5Bhla7dS8TxnqilXkDB9veGr-44,2492
35
+ python_blazarclient-4.2.0.dist-info/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
36
+ python_blazarclient-4.2.0.dist-info/METADATA,sha256=bHFCDvuuQJc2n6kdon2OTTqTOK3_OBIxt6vMGOnh9_4,2340
37
+ python_blazarclient-4.2.0.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
38
+ python_blazarclient-4.2.0.dist-info/entry_points.txt,sha256=GeegiiG8GncGF7f6jonugjHhqNEYVaWe6TbYLhyhPWk,1687
39
+ python_blazarclient-4.2.0.dist-info/pbr.json,sha256=LUclCjnbsj4BzZtiu6GiFpsQ1wTZMqdPMSuS04wESZA,46
40
+ python_blazarclient-4.2.0.dist-info/top_level.txt,sha256=yQx5ICRTYACa8B3aVm1rnJI6miXR0odH3BkwmoKD-0E,13
41
+ python_blazarclient-4.2.0.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ {"git_version": "20c3119", "is_release": true}
@@ -1 +0,0 @@
1
- {"git_version": "e1f6650", "is_release": true}