OpenPOWER: Password is not mandatory for resource dump

In dump manager password is always expected for creating
resource dump, which is not needed. So removing the
restriction and making password an optional argument.

Tests:
Request resource dump with providing password.
Tested resource dump without giving password.

Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: I46863409e9eb4b16727a78c904853d1408e4462a
diff --git a/dump-extensions/openpower-dumps/dump_manager_resource.cpp b/dump-extensions/openpower-dumps/dump_manager_resource.cpp
index 521b0b8..e4cb346 100644
--- a/dump-extensions/openpower-dumps/dump_manager_resource.cpp
+++ b/dump-extensions/openpower-dumps/dump_manager_resource.cpp
@@ -166,24 +166,24 @@
             convertCreateParametersToString(CreateParameters::Password));
     if (iter == params.end())
     {
-        log<level::ERR>("Required argument password is missing");
-        elog<InvalidArgument>(Argument::ARGUMENT_NAME("PASSOWORD"),
-                              Argument::ARGUMENT_VALUE("MISSING"));
+        log<level::INFO>("Password is not provided for resource dump");
     }
-
-    try
+    else
     {
-        pwd = std::get<std::string>(iter->second);
-    }
-    catch (const std::bad_variant_access& e)
-    {
-        // Exception will be raised if the input is not string
-        log<level::ERR>(
-            fmt::format("An invalid password string is passed errormsg({})",
-                        e.what())
-                .c_str());
-        elog<InvalidArgument>(Argument::ARGUMENT_NAME("PASSWORD"),
-                              Argument::ARGUMENT_VALUE("INVALID INPUT"));
+        try
+        {
+            pwd = std::get<std::string>(iter->second);
+        }
+        catch (const std::bad_variant_access& e)
+        {
+            // Exception will be raised if the input is not string
+            log<level::ERR>(
+                fmt::format("An invalid password string is passed errormsg({})",
+                            e.what())
+                    .c_str());
+            elog<InvalidArgument>(Argument::ARGUMENT_NAME("PASSWORD"),
+                                  Argument::ARGUMENT_VALUE("INVALID INPUT"));
+        }
     }
 
     try