Remove dead hostname code

The original code said we'd remove this in Q4 2021, and it's now Q4
2021.  So far as I've heard, no user has reported this, and no system
has needed to enable this for backward compatibility.  The original
author of the patch has stated that it's no longer used, so this is
effectively dead code, lets remove it.

Also, added a missing return in what was previously a #ifdef

Tested:
Code builds.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1d58efb92ed06b7632d57440072834a1d02e87dd
diff --git a/meson.build b/meson.build
index 650a5ec..66258a8 100644
--- a/meson.build
+++ b/meson.build
@@ -211,16 +211,6 @@
     },section : 'Enabled Features')
 endif
 
-if( get_option('redfish-allow-deprecated-hostname-patch').enabled())
- add_project_arguments([
-   '-DBMCWEB_ALLOW_DEPRECATED_HOSTNAME_PATCH'
-   ],
-  language : 'cpp')
-
-  summary({'hostname-patch' :'-DBMCWEB_ALLOW_DEPRECATED_HOSTNAME_PATCH'
-    },section : 'Enabled Features')
-endif
-
 if( get_option('redfish-allow-deprecated-power-thermal').enabled())
  add_project_arguments([
    '-DBMCWEB_ALLOW_DEPRECATED_POWER_THERMAL'
diff --git a/meson_options.txt b/meson_options.txt
index ff5b887..ada1957 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -29,7 +29,6 @@
 option('ibm-management-console', type : 'feature', value : 'disabled', description : 'Enable the IBM management console specific functionality. Paths are under \'/ibm/v1/\'')
 option('google-api', type : 'feature', value : 'disabled', description : 'Enable the Google specific functionality. Paths are under \'/google/v1/\'')
 option('http-body-limit', type: 'integer', min : 0, max : 512, value : 30, description : 'Specifies the http request body length limit')
-option('redfish-allow-deprecated-hostname-patch', type : 'feature', value : 'disabled', description : 'Enable/disable Managers/bmc/NetworkProtocol HostName PATCH commands. The default condition is to prevent HostName changes from this URI, following the Redfish schema. Enabling this switch permits the HostName to be PATCHed at this URI. In Q4 2021 this feature will be removed, and the Redfish schema enforced, making the HostName read-only.')
 option('redfish-new-powersubsystem-thermalsubsystem', type : 'feature', value : 'disabled', description : 'Enable/disable the new PowerSubsystem, ThermalSubsystem, and all children schemas. This includes displaying all sensors in the SensorCollection. At a later date, this feature will be defaulted to enabled.')
 option('redfish-allow-deprecated-power-thermal', type : 'feature', value : 'enabled', description : 'Enable/disable the old Power / Thermal. The default condition is allowing the old Power / Thermal.')
 option ('https_port', type : 'integer', min : 1, max : 65535, value : 443, description : 'HTTPS Port number.')
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index a9f5005..a06611f 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -209,26 +209,6 @@
     }
 } // namespace redfish
 
-#ifdef BMCWEB_ALLOW_DEPRECATED_HOSTNAME_PATCH
-inline void
-    handleHostnamePatch(const std::string& hostName,
-                        const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    crow::connections::systemBus->async_method_call(
-        [asyncResp](const boost::system::error_code ec) {
-            if (ec)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-        },
-        "xyz.openbmc_project.Network", "/xyz/openbmc_project/network/config",
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Network.SystemConfiguration", "HostName",
-        std::variant<std::string>(hostName));
-}
-#endif
-
 inline void handleNTPProtocolEnabled(
     const bool& ntpEnabled, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
 {
@@ -391,11 +371,8 @@
                 asyncResp->res.result(boost::beast::http::status::no_content);
                 if (newHostName)
                 {
-#ifdef BMCWEB_ALLOW_DEPRECATED_HOSTNAME_PATCH
-                    handleHostnamePatch(*newHostName, asyncResp);
-#else
                     messages::propertyNotWritable(asyncResp->res, "HostName");
-#endif
+                    return;
                 }
 
                 if (ntp)