dbca-utils 3.0.0__tar.gz → 3.0.1__tar.gz

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 (22) hide show
  1. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/PKG-INFO +1 -1
  2. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/pyproject.toml +1 -1
  3. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/src/dbca_utils/healthcheck/healthcheck.py +13 -10
  4. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/LICENSE +0 -0
  5. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/README.md +0 -0
  6. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/src/dbca_utils/__init__.py +0 -0
  7. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/src/dbca_utils/apps.py +0 -0
  8. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/src/dbca_utils/healthcheck/__init__.py +0 -0
  9. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/src/dbca_utils/healthcheck/urls.py +0 -0
  10. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/src/dbca_utils/middleware.py +0 -0
  11. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/src/dbca_utils/models.py +0 -0
  12. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/src/dbca_utils/utils.py +0 -0
  13. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/tests/__init__.py +0 -0
  14. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/tests/apps.py +0 -0
  15. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/tests/migrations/0001_initial.py +0 -0
  16. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/tests/migrations/__init__.py +0 -0
  17. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/tests/models.py +0 -0
  18. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/tests/settings.py +0 -0
  19. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/tests/templates/tests/test_model_list.html +0 -0
  20. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/tests/tests.py +0 -0
  21. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/tests/urls.py +0 -0
  22. {dbca_utils-3.0.0 → dbca_utils-3.0.1}/tests/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dbca-utils
3
- Version: 3.0.0
3
+ Version: 3.0.1
4
4
  Summary: Utilities for DBCA Django apps
5
5
  Author-Email: Rocky Chen <rocky.chen@dbca.wa.gov.au>, Ashley Felton <ashley.felton@dbca.wa.gov.au>
6
6
  License-Expression: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dbca-utils"
3
- version = "3.0.0"
3
+ version = "3.0.1"
4
4
  description = "Utilities for DBCA Django apps"
5
5
  authors = [
6
6
  { name = "Rocky Chen", email = "rocky.chen@dbca.wa.gov.au" },
@@ -467,34 +467,34 @@ if WORKLOADS > 0 and WORKLOAD_DEPLOYMENT:
467
467
  logger.debug("Get assigned workloads:{}".format(assignedworkloads))
468
468
  datas = {}
469
469
  index = 0
470
- reassigned_workloads = 0
470
+ reassign_workloads = 0
471
471
  for workloadname in WORKLOADNAMES:
472
472
  servername = assignedworkloads.get(workloadname)
473
473
  if not servername:
474
474
  #workloadname is not assined to a server
475
- reassigned_workloads += 1
475
+ reassign_workloads += 1
476
476
  continue
477
477
 
478
478
  #workload name is assigned to a server
479
479
  if servername not in servers_res :
480
480
  #the server is not available
481
- reassigned_workloads += 1
481
+ reassign_workloads += 1
482
482
  continue
483
483
 
484
484
  datas[servername] = servers_res[servername]
485
485
  if servers_res[servername][0] in OFFLINE_STATUSCODE_LIST:
486
486
  #Related workload is offline, need to reassign another workload
487
- reassigned_workloads += 1
487
+ reassign_workloads += 1
488
488
  del servers_res[servername]
489
489
 
490
490
  assignedworkloads_changed = False
491
- if reassigned_workloads > 0:
491
+ if reassign_workloads > 0:
492
492
  #Some workloads are not assigned a workload name or are not available
493
493
  #Using the following to replace the exisint one with new one if possible
494
494
  #Step 1: Replace the unavailable server with a new one
495
495
  #Step 2: Assign the new server to the missing assignedworkloads(missed in the assignedworkloads before)
496
496
  step = 0
497
- while reassigned_workloads > 0:
497
+ while reassign_workloads > 0:
498
498
  step += 1
499
499
  for workloadname in WORKLOADNAMES:
500
500
  servername = assignedworkloads.get(workloadname)
@@ -525,10 +525,10 @@ if WORKLOADS > 0 and WORKLOAD_DEPLOYMENT:
525
525
  assignedworkloads_changed = True
526
526
 
527
527
  if servers_res:
528
- reassigned_workloads -= 1
528
+ reassign_workloads -= 1
529
529
  else:
530
- reassigned_workloads = 0
531
- if reassigned_workloads == 0:
530
+ reassign_workloads = 0
531
+ if reassign_workloads == 0:
532
532
  break
533
533
 
534
534
  if assignedworkloads_changed:
@@ -544,9 +544,12 @@ if WORKLOADS > 0 and WORKLOAD_DEPLOYMENT:
544
544
  result[workloadname] = "Can't find an available host for this non-assigned host.registered workloads: {0}, assigned workloads:{1}".format(str_workloads(workloads),assignedworkloads)
545
545
  elif servername not in datas:
546
546
  result[workloadname] = "Can't find an available host for this assigned offline host({2}).registered workloads: {0}, assigned workloads:{1}".format(str_workloads(workloads),assignedworkloads,servername)
547
- else:
547
+ elif datas[servername][0] == 200:
548
548
  result[workloadname] = datas[servername][1]
549
549
  result[workloadname]["hostname"] = servername
550
+ else:
551
+ result[workloadname] = "{}: {}".format(servername,datas[servername][1])
552
+
550
553
 
551
554
  datas.clear()
552
555
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes