Skip to content

Conversation

scottstephens
Copy link
Contributor

This PR adds a command line argument to the program, --enable-tpm, that enables the TPM in the generated AMI.

@arianvp
Copy link
Member

arianvp commented Sep 12, 2025

LGTM

@arianvp
Copy link
Member

arianvp commented Sep 12, 2025

CI is failing:

     > + /nix/store/wrma7wfalir4gybgwqfcj1cgq2yahypm-python3.13-mypy-1.15.0/bin/mypy ''
       > src/upload_ami/upload_ami.py:183: error: Name "enable_tpm" is not defined  [name-defined]
       > src/upload_ami/upload_ami.py:191: error: Argument 1 to "register_image" of "EC2Client" has incompatible type "**dict[str, object]"; expected "str"  [arg-type]
       > src/upload_ami/upload_ami.py:191: error: Argument 1 to "register_image" of "EC2Client" has incompatible type "**dict[str, object]"; expected "Sequence[str]"  [arg-type]
       > src/upload_ami/upload_ami.py:191: error: Argument 1 to "register_image" of "EC2Client" has incompatible type "**dict[str, object]"; expected "Literal['legacy-bios', 'uefi', 'uefi-preferred']"  [arg-type]
       > src/upload_ami/upload_ami.py:191: error: Argument 1 to "register_image" of "EC2Client" has incompatible type "**dict[str, object]"; expected "Literal['v2.0']"  [arg-type]
       > src/upload_ami/upload_ami.py:191: error: Argument 1 to "register_image" of "EC2Client" has incompatible type "**dict[str, object]"; expected "Sequence[TagSpecificationTypeDef | TagSpecificationOutputTypeDef]"  [arg-type]
       > src/upload_ami/upload_ami.py:191: error: Argument 1 to "register_image" of "EC2Client" has incompatible type "**dict[str, object]"; expected "bool"  [arg-type]
       > src/upload_ami/upload_ami.py:191: error: Argument 1 to "register_image" of "EC2Client" has incompatible type "**dict[str, object]"; expected "Literal['arm64', 'arm64_mac', 'i386', 'x86_64', 'x86_64_mac']"  [arg-type]
       > src/upload_ami/upload_ami.py:191: error: Argument 1 to "register_image" of "EC2Client" has incompatible type "**dict[str, object]"; expected "Sequence[BlockDeviceMappingTypeDef]"  [arg-type]
       > src/upload_ami/upload_ami.py:330: error: Too many arguments for "register_image_if_not_exists"  [call-arg]
       ```

@scottstephens
Copy link
Contributor Author

Checks should be fixed now. Sorry, didn't understand how formatting and type checking worked on my first attempt.

@arianvp arianvp merged commit 6407dd8 into NixOS:main Sep 12, 2025
7 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants