<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def has_pkgs_signed_with(self, allowed_keys):
 """ Check signature of packages installed in image. Raises exception when * rpm binary is not installed in image * parsing of rpm fails * there are packages in image that are not signed with one of allowed keys :param allowed_keys: list of allowed keys :return: bool """


        if not allowed_keys or not isinstance(allowed_keys, list):
            raise ConuException("allowed_keys must be a list")
        command = ['rpm', '-qa', '--qf', '%{name} %{SIGPGP:pgpsig}\n']
        cont = self.run_via_binary(command=command)
        try:
            out = cont.logs_unicode()[:-1].split('\n')
            check_signatures(out, allowed_keys)
        finally:
            cont.stop()
            cont.delete()
        return True