Clean up .robot files

  - Run rflint on .robot to ensure they conform to the standards.
    Fix the files that don't.
  - Add robot_custom_rules.py file for our repository custom rules.
  - run pycodestyle on new changes.

Change-Id: Idb2b895b81cb00220076a32b413e124980f4057b
Signed-off-by: Joy Onyerikwu <onyekachukwu.joy.onyerikwu@ibm.com>
diff --git a/redfish/__init__.robot b/redfish/__init__.robot
index eee33ba..ecadea3 100644
--- a/redfish/__init__.robot
+++ b/redfish/__init__.robot
@@ -13,5 +13,3 @@
     Run Keyword And Ignore Error  Get BMC PNOR Version
     # Run Keyword  Check BMC Performance
     Check BMC Performance
-
-
diff --git a/redfish/account_service/test_user_account.robot b/redfish/account_service/test_user_account.robot
index bec75dd..427f4ec 100644
--- a/redfish/account_service/test_user_account.robot
+++ b/redfish/account_service/test_user_account.robot
@@ -169,8 +169,9 @@
 
     Redfish Create User  admin_user  TestPwd123  Administrator   ${True}
 
-    Redfish.Patch  ${REDFISH_ACCOUNTS_SERVICE_URI}
-    ...  body={'AccountLockoutThreshold': ${account_lockout_threshold}, 'AccountLockoutDuration': ${account_lockout_duration}}
+    ${payload}=  Create Dictionary  AccountLockoutThreshold=${account_lockout_threshold}
+    ...  AccountLockoutDuration=${account_lockout_duration}
+    Redfish.Patch  ${REDFISH_ACCOUNTS_SERVICE_URI}  body=${payload}
 
     # Make ${account_lockout_threshold} failed login attempts.
     Repeat Keyword  ${account_lockout_threshold} times
diff --git a/redfish/managers/test_managers_bmc_time.robot b/redfish/managers/test_managers_bmc_time.robot
index 2e6409c..1278255 100644
--- a/redfish/managers/test_managers_bmc_time.robot
+++ b/redfish/managers/test_managers_bmc_time.robot
@@ -169,5 +169,3 @@
 
     Printn
     Redfish.Login
-
-
diff --git a/robot_custom_rules.py b/robot_custom_rules.py
new file mode 100644
index 0000000..39eecdf
--- /dev/null
+++ b/robot_custom_rules.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+# Custom rules file for robotframework-lint.
+# Example usage: python -m rflint -A robot_standards -R robot_custom_rules.py .
+import re
+from rflint.common import SuiteRule, ERROR
+
+
+class ExtendInvalidTable(SuiteRule):
+    r'''
+    Extend robotframework-lint SuiteRule function for InvalidTable to allow a table section if it is
+    a section of comments. e.g "*** Comments ***"
+    '''
+    severity = ERROR
+
+    def apply(self, suite):
+        for table in suite.tables:
+            if (not re.match(r'^(settings?|metadata|(test )?cases?|(user )?keywords?|variables?|comments?)$',
+                             table.name, re.IGNORECASE)):
+                self.report(suite, "Unknown table name '%s'" % table.name, table.linenumber)
diff --git a/robot_standards b/robot_standards
index 87b1196..415e769 100644
--- a/robot_standards
+++ b/robot_standards
@@ -4,3 +4,4 @@
 --ignore FileTooLong
 --ignore TooManyTestSteps
 --ignore TooManyTestCases
+--ignore InvalidTable
diff --git a/security/test_bmc_ssh_security.robot b/security/test_bmc_ssh_security.robot
index 6c01096..fae0628 100644
--- a/security/test_bmc_ssh_security.robot
+++ b/security/test_bmc_ssh_security.robot
@@ -36,11 +36,11 @@
     # debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,
     #         aes128-gcm@openssh.com,aes256-gcm@openssh.com
     # debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,
-    #         hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,
-    #         hmac-sha2-256,hmac-sha2-512,hmac-sha1
+    #         hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,
+    #         umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
     # debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,
-    #         hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,
-    #         hmac-sha2-256,hmac-sha2-512,hmac-sha1
+    #         hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,
+    #         umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
 
     # Example of weak algorithms to check:
     # - encryption: triple-DES ("DES-CBC3").
diff --git a/tests/test_fans.robot b/tests/test_fans.robot
index f82fb2e..28b31f7 100755
--- a/tests/test_fans.robot
+++ b/tests/test_fans.robot
@@ -40,5 +40,6 @@
 *** Keywords ***
 
 Suite Setup Execution
+    [Documentation]  Get and set fan count and names.
     ${number_of_fans}  ${fan_names}=  Get Fan Count And Names
     Set Suite Variable  ${number_of_fans}  children=true