Removed unicode character from dbus uri
Changes:
- Remove unicode character such as `- and |- from dbus uri for introspecting dbus
Tested:
- Ran All The Scripts Successfully
Change-Id: I20dd85a3825624f38a40040d6e4a208f0c38781f
Signed-off-by: ganesanb <ganesanb@ami.com>
diff --git a/lib/bmc_dbus.robot b/lib/bmc_dbus.robot
index 160fec1..0256dfe 100644
--- a/lib/bmc_dbus.robot
+++ b/lib/bmc_dbus.robot
@@ -61,7 +61,7 @@
@{dbus_list}= Create List
FOR ${item} IN @{dbus_uri_list}
${item}= Set Variable ${item.strip()}
- ${item}= return_decoded_string ${item}
+ ${item}= Remove Unicode From Uri ${item}
Append To List ${dbus_list} ${item}
END
diff --git a/lib/utils.py b/lib/utils.py
index c8971b1..d19f840 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -19,7 +19,7 @@
from robot.utils import DotDict
except ImportError:
pass
-
+import re
# The code base directory will be one level up from the directory containing this module.
code_base_dir_path = os.path.dirname(os.path.dirname(__file__)) + os.sep
@@ -484,3 +484,11 @@
encoded_string = input.encode("ascii", "ignore")
decoded_string = encoded_string.decode()
return decoded_string
+
+
+def remove_unicode_from_uri(uri):
+ r"""
+ returns dbus uri without unicode in prefix
+ """
+
+ return re.sub("`-|\\|-", "", uri)