diff --git a/providers/tpm2/bin/tpm2_capabilities.py b/providers/tpm2/bin/tpm2_capabilities.py index d38c835f8..c8ced1607 100755 --- a/providers/tpm2/bin/tpm2_capabilities.py +++ b/providers/tpm2/bin/tpm2_capabilities.py @@ -87,8 +87,11 @@ try: algs_caps = subprocess.check_output(['tpm2_getcap', 'algorithms']) pcrs_caps = subprocess.check_output(['tpm2_getcap', 'pcrs']) -except subprocess.CalledProcessError: - raise SystemExit +except (subprocess.CalledProcessError, FileNotFoundError): + raise SystemExit( + "Please make sure you have installed tpm-tools and tpm chip." + ) + algs_list = yaml.load(algs_caps, Loader=yaml.FullLoader) pcrs_list = yaml.load(pcrs_caps, Loader=yaml.FullLoader)