black: re-format

black and isort are enabled in the openbmc-build-scripts on Python files
to have a consistent formatting.  Re-run the formatter on the whole
repository.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I944f1915ece753f72a3fa654902d445a9749d0f9
diff --git a/lib/state_map.py b/lib/state_map.py
index abff002..e2271b7 100644
--- a/lib/state_map.py
+++ b/lib/state_map.py
@@ -13,93 +13,87 @@
 from robot.libraries.BuiltIn import BuiltIn
 
 robot_pgm_dir_path = os.path.dirname(__file__) + os.sep
-repo_data_dir_path = re.sub('/lib', '/data', robot_pgm_dir_path)
+repo_data_dir_path = re.sub("/lib", "/data", robot_pgm_dir_path)
 sys.path.append(repo_data_dir_path)
 
 import gen_robot_keyword as keyword  # NOQA
-import variables as var              # NOQA
+import variables as var  # NOQA
 
 BuiltIn().import_resource("state_manager.robot")
 BuiltIn().import_resource("rest_client.robot")
 
-platform_arch_type = os.environ.get('PLATFORM_ARCH_TYPE', '') or \
-    BuiltIn().get_variable_value("${PLATFORM_ARCH_TYPE}", default="power")
+platform_arch_type = os.environ.get(
+    "PLATFORM_ARCH_TYPE", ""
+) or BuiltIn().get_variable_value("${PLATFORM_ARCH_TYPE}", default="power")
 
 # We will build eventually the mapping for warm, cold reset as well.
 VALID_STATES = {
-    'reboot':
-    {
+    "reboot": {
         # (Power Policy, BMC state, Chassis State, Host State)
-        ('LEAVE_OFF', 'Ready', 'Off', 'Off'),
-        ('ALWAYS_POWER_ON', 'Ready', 'On', 'Running'),
-        ('ALWAYS_POWER_ON', 'Ready', 'On', 'Off'),
-        ('RESTORE_LAST_STATE', 'Ready', 'On', 'Running'),
-        ('RESTORE_LAST_STATE', 'Ready', 'On', 'Off'),
-        ('ALWAYS_POWER_OFF', 'Ready', 'On', 'Running'),
-        ('ALWAYS_POWER_OFF', 'Ready', 'Off', 'Off'),
+        ("LEAVE_OFF", "Ready", "Off", "Off"),
+        ("ALWAYS_POWER_ON", "Ready", "On", "Running"),
+        ("ALWAYS_POWER_ON", "Ready", "On", "Off"),
+        ("RESTORE_LAST_STATE", "Ready", "On", "Running"),
+        ("RESTORE_LAST_STATE", "Ready", "On", "Off"),
+        ("ALWAYS_POWER_OFF", "Ready", "On", "Running"),
+        ("ALWAYS_POWER_OFF", "Ready", "Off", "Off"),
     },
 }
 
 VALID_BOOT_STATES = {
-    'Off':  # Valid states when Host is Off.
-    {
+    "Off": {  # Valid states when Host is Off.
         # (BMC , Chassis , Host , BootProgress, OperatingSystemState)
         (
             "xyz.openbmc_project.State.BMC.BMCState.Ready",
             "xyz.openbmc_project.State.Chassis.PowerState.Off",
             "xyz.openbmc_project.State.Host.HostState.Off",
             "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified",
-            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive"
+            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
         ),
     },
-    'Reboot':  # Valid states when BMC reset to standby.
-    {
+    "Reboot": {  # Valid states when BMC reset to standby.
         # (BMC , Chassis , Host , BootProgress, OperatingSystemState)
         (
             "xyz.openbmc_project.State.BMC.BMCState.Ready",
             "xyz.openbmc_project.State.Chassis.PowerState.Off",
             "xyz.openbmc_project.State.Host.HostState.Off",
             "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified",
-            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive"
+            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
         ),
     },
-    'Running':  # Valid states when Host is powering on.
-    {
+    "Running": {  # Valid states when Host is powering on.
         # (BMC , Chassis , Host , BootProgress, OperatingSystemState)
         (
             "xyz.openbmc_project.State.BMC.BMCState.Ready",
             "xyz.openbmc_project.State.Chassis.PowerState.On",
             "xyz.openbmc_project.State.Host.HostState.Running",
             "xyz.openbmc_project.State.Boot.Progress.ProgressStages.MotherboardInit",
-            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive"
+            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
         ),
     },
-    'Booted':  # Valid state when Host is booted.
-    {
+    "Booted": {  # Valid state when Host is booted.
         # (BMC , Chassis , Host , BootProgress, OperatingSystemState)
         (
             "xyz.openbmc_project.State.BMC.BMCState.Ready",
             "xyz.openbmc_project.State.Chassis.PowerState.On",
             "xyz.openbmc_project.State.Host.HostState.Running",
             "xyz.openbmc_project.State.Boot.Progress.ProgressStages.OSStart",
-            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete"
+            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete",
         ),
     },
-    'ResetReload':  # Valid state BMC reset reload when host is booted.
-    {
+    "ResetReload": {  # Valid state BMC reset reload when host is booted.
         # (BMC , Chassis , Host , BootProgress, OperatingSystemState)
         (
             "xyz.openbmc_project.State.BMC.BMCState.Ready",
             "xyz.openbmc_project.State.Chassis.PowerState.On",
             "xyz.openbmc_project.State.Host.HostState.Running",
             "xyz.openbmc_project.State.Boot.Progress.ProgressStages.OSStart",
-            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete"
+            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete",
         ),
     },
 }
 REDFISH_VALID_BOOT_STATES = {
-    'Off':  # Valid states when Host is Off.
-    {
+    "Off": {  # Valid states when Host is Off.
         # (BMC , Chassis , Host , BootProgress)
         (
             "Enabled",
@@ -108,8 +102,7 @@
             "None",
         ),
     },
-    'Reboot':  # Valid states when BMC reset to standby.
-    {
+    "Reboot": {  # Valid states when BMC reset to standby.
         # (BMC , Chassis , Host , BootProgress)
         (
             "Enabled",
@@ -118,8 +111,7 @@
             "None",
         ),
     },
-    'Running':  # Valid states when Host is powering on.
-    {
+    "Running": {  # Valid states when Host is powering on.
         # (BMC , Chassis , Host , BootProgress)
         (
             "Enabled",
@@ -128,8 +120,7 @@
             "OSRunning",
         ),
     },
-    'Booted':  # Valid state when Host is booted.
-    {
+    "Booted": {  # Valid state when Host is booted.
         # (BMC , Chassis , Host , BootProgress)
         (
             "Enabled",
@@ -138,8 +129,7 @@
             "OSRunning",
         ),
     },
-    'ResetReload':  # Valid state BMC reset reload when host is booted.
-    {
+    "ResetReload": {  # Valid state BMC reset reload when host is booted.
         # (BMC , Chassis , Host , BootProgress)
         (
             "Enabled",
@@ -160,41 +150,45 @@
                 for x in state_tuple
                 if not (
                     x.startswith("xyz.openbmc_project.State.Boot.Progress")
-                    or x.startswith("xyz.openbmc_project.State.OperatingSystem")
+                    or x.startswith(
+                        "xyz.openbmc_project.State.OperatingSystem"
+                    )
                 )
             )
             VALID_BOOT_STATES_X86[state_name].add(state_tuple_new)
     VALID_BOOT_STATES = VALID_BOOT_STATES_X86
 
 
-class state_map():
-
+class state_map:
     def get_boot_state(self):
         r"""
         Return the system state as a tuple of bmc, chassis, host state,
         BootProgress and OperatingSystemState.
         """
 
-        status, state = keyword.run_key("Read Properties  "
-                                        + var.SYSTEM_STATE_URI + "enumerate")
-        bmc_state = state[var.SYSTEM_STATE_URI + 'bmc0']['CurrentBMCState']
-        chassis_state = \
-            state[var.SYSTEM_STATE_URI + 'chassis0']['CurrentPowerState']
-        host_state = state[var.SYSTEM_STATE_URI + 'host0']['CurrentHostState']
+        status, state = keyword.run_key(
+            "Read Properties  " + var.SYSTEM_STATE_URI + "enumerate"
+        )
+        bmc_state = state[var.SYSTEM_STATE_URI + "bmc0"]["CurrentBMCState"]
+        chassis_state = state[var.SYSTEM_STATE_URI + "chassis0"][
+            "CurrentPowerState"
+        ]
+        host_state = state[var.SYSTEM_STATE_URI + "host0"]["CurrentHostState"]
         if platform_arch_type == "x86":
-            return (str(bmc_state),
-                    str(chassis_state),
-                    str(host_state))
+            return (str(bmc_state), str(chassis_state), str(host_state))
         else:
-            boot_state = state[var.SYSTEM_STATE_URI + 'host0']['BootProgress']
-            os_state = \
-                state[var.SYSTEM_STATE_URI + 'host0']['OperatingSystemState']
+            boot_state = state[var.SYSTEM_STATE_URI + "host0"]["BootProgress"]
+            os_state = state[var.SYSTEM_STATE_URI + "host0"][
+                "OperatingSystemState"
+            ]
 
-            return (str(bmc_state),
-                    str(chassis_state),
-                    str(host_state),
-                    str(boot_state),
-                    str(os_state))
+            return (
+                str(bmc_state),
+                str(chassis_state),
+                str(host_state),
+                str(boot_state),
+                str(os_state),
+            )
 
     def valid_boot_state(self, boot_type, state_set):
         r"""
@@ -222,7 +216,9 @@
         state_dict                  State dictionary.
         """
 
-        if set(state_dict.values()) in set(REDFISH_VALID_BOOT_STATES[boot_type]):
+        if set(state_dict.values()) in set(
+            REDFISH_VALID_BOOT_STATES[boot_type]
+        ):
             return True
         else:
             return False