Skip to content

Commit 15daa49

Browse files
author
Tom Warnock
committed
fix case issue
1 parent 97a5f61 commit 15daa49

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Pipfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
8+
[packages]
9+
10+
[requires]
11+
python_version = "3.7"

cloudendure/cloudendure.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ def check_licenses(self) -> Dict[str, Any]:
429429
license_data: Dict[str, Any] = machine.get("license", {})
430430
license_use: str = license_data.get("startOfUseDateTime")
431431
license_date: datetime = datetime.datetime.strptime(license_use, "%Y-%m-%dT%H:%M:%S.%f%z")
432+
print(f"{machine_name} agent install: {license_date}")
432433
delta: timedelta = now - license_date
433434
if expirationday < delta:
434435
response_dict[machine_name] = {
@@ -534,13 +535,14 @@ def launch(self) -> Dict[str, Any]:
534535
for machine in json.loads(machines_response.text).get("items", []):
535536
source_props: Dict[str, Any] = machine.get("sourceProperties", {})
536537
machine_data: Dict[str, Any] = {}
537-
if _machine == source_props.get("name", "NONE"):
538+
ce_name = source_props.get("name","NONE")
539+
if _machine == ce_name.upper():
538540
if machine.get("replica"):
539541
print("Target machine already launched")
540542
self.event_handler.add_event(Event.EVENT_ALREADY_LAUNCHED, machine_name=_machine)
541543
continue
542544
machine_data = {
543-
"items": [{"machineId": machine["id"]}],
545+
"items": [{"machineId": ce_name}],
544546
"launchType": "TEST",
545547
}
546548

@@ -563,7 +565,7 @@ def launch(self) -> Dict[str, Any]:
563565
print("ERROR: Launch target machine failed!")
564566
self.event_handler.add_event(Event.EVENT_FAILED, machine_name=_machine)
565567
else:
566-
print(f"Machine: ({source_props['name']}) - Not a machine we want to launch...")
568+
#print(f"Machine: ({source_props['name']}) - Not a machine we want to launch...")
567569
self.event_handler.add_event(Event.EVENT_IGNORED, machine_name=_machine)
568570
return response_dict
569571

0 commit comments

Comments
 (0)