def update_hosts(self, host_names):
if self.host_access:<EOL><INDENT>curr_hosts = [access.host.name for access in self.host_access]<EOL><DEDENT>else:<EOL><INDENT>curr_hosts = []<EOL><DEDENT>if set(curr_hosts) == set(host_names):<EOL><INDENT>log.info('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>return None<EOL><DEDENT>new_hosts = [UnityHostList.get(cli=self._cli, name=host_name)[<NUM_LIT:0>]<EOL>for host_name in host_names]<EOL>new_access = [{'<STR_LIT:host>': item,<EOL>'<STR_LIT>': HostLUNAccessEnum.PRODUCTION}<EOL>for item in new_hosts]<EOL>resp = self.modify(host_access=new_access)<EOL>resp.raise_if_err()<EOL>return resp<EOL>
Primarily for puppet-unity use.

        Update the hosts for the lun if needed.

        :param host_names: specify the new hosts which access the LUN.