<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_hostname(self):
 """Parses the global config and returns the hostname value Returns: dict: The configured value for hostname. The returned dict object is intended to be merged into the resource dict """

        value = 'localhost'
        match = re.search(r'^hostname ([^\s]+)$', self.config, re.M)
        if match:
            value = match.group(1)
        return dict(hostname=value)