Add secondary key for fetching az key #1503
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
There are cases where the fact with primary key is not available such as puppet did not finish, fetch az fact from another key
Test plan
https://deploy.pinadmin.com/env/deploy-init/test/deploy/
Deploy a new version and restart helloworld deployment
Remove the primary key and restart deployment, fetch info from the secondary fact key
I0308 22:20:05.907.7978134155273 MainThread /root/.pex/installed_wheels/b947a9193e85a595eee5e84664cd4e641a0fc43acd6f538159a94e60f623e869/deploy_agent-1.2.60-py3-none-any.whl/deployd/client/client.py:199] Host information is loaded. Host name: helloworlddummyservice-server-u20-0a0311fd, IP: 10.3.17.253, host id: i-06e65262a286e5a58, agent_version=1.2.46-pinterest-1.0.2, autoscaling_group: helloworlddummyservice-server-u20, availability_zone: us-east-1a, ec2_tags: {"Autoscaling": "helloworlddummyservice-server-u20", "Name": "helloworlddummyservice-server-u20-0a0311fd", "aws:autoscaling:groupName": "helloworlddummyservice-server-u20", "aws:ec2launchtemplate:id": "lt-09d19658f55f87567", "aws:ec2launchtemplate:version": "13", "pinterest.com/identity": "nimbus.teletraan.teletraan.aws-us-east-1.helloworlddummyservice-server.u20", "pinterest.com/nimbus-uuid": "9d24629e-3673-41b1-872f-f2c3887a28a1", "service_mapping": "helloworlddummyservice-server", "usage_tag": "SRE", "availability_zone": "us-east-1a"}, stage_type: None, group: ['CMP', 'helloworlddummyservice-server-u20', 'metrics-agent-prod-sidecar', 'singer-prod-sidecar', 'mcrouter-prod-sidecar', 'envoy-sidecar', 'tcollector-prod-sidecar', 'zk_update_monitor-prod-sidecar'], account id: 998131032990