AETHER-3648 Support loglevel configuration in enodebd
AETHER-3020 Firmware upgrade feature: integrate firmware url to enb cfg
Change-Id: Iba2e08fc6aa31c23f9eedb70ebf250c2d2066e8d
diff --git a/state_machines/acs_state_utils.py b/state_machines/acs_state_utils.py
index e35f37d..b335546 100644
--- a/state_machines/acs_state_utils.py
+++ b/state_machines/acs_state_utils.py
@@ -268,6 +268,7 @@
data_model: DataModel,
exclude_admin: bool = False,
) -> Dict[ParameterName, Any]:
+
""" Returns a map of param names to values that we need to set """
param_values = get_param_values_to_set(
desired_cfg, device_cfg,
diff --git a/state_machines/enb_acs_states.py b/state_machines/enb_acs_states.py
index 2c3e53b..2a0a911 100644
--- a/state_machines/enb_acs_states.py
+++ b/state_machines/enb_acs_states.py
@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+import datetime
import time
from abc import ABC, abstractmethod
from collections import namedtuple
@@ -1294,6 +1295,8 @@
def get_msg(self, message: Any) -> AcsMsgAndTransition:
+ enodebd_cfg = load_service_config("enodebd")
+
# Switch enodeb status to firmware upgrading
metrics.set_enb_status(
self.acs.device_cfg.get_parameter("Serial number"),
@@ -1301,13 +1304,13 @@
)
request = models.Download()
- request.CommandKey = "20220206215200"
+ request.CommandKey = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
request.FileType = "1 Firmware Upgrade Image"
- request.URL = "http://10.128.250.131/firmware/Qproject_RC3923_2202151120.ffw"
- request.Username = ""
- request.Password = ""
- request.FileSize = 57399275
- request.TargetFileName = "Qproject_RC3923_2202151120.ffw"
+ request.URL = enodebd_cfg["firmware"]["url"]
+ request.Username = enodebd_cfg["firmware"]["username"]
+ request.Password = enodebd_cfg["firmware"]["password"]
+ request.FileSize = enodebd_cfg["firmware"]["filesize"]
+ request.TargetFileName = enodebd_cfg["firmware"]["filename"]
request.DelaySeconds = 0
request.SuccessURL = ""
request.FailureURL = ""