in src/slurm_plugin/instance_manager.py [0:0]
def _store_assigned_hostnames(self, nodes):
logger.info("Saving assigned hostnames in DynamoDB")
if not self._table:
raise HostnameTableStoreError("Empty table name configuration parameter.")
if nodes:
with self._table.batch_writer() as batch_writer:
for nodename, instance in nodes.items():
# Note: These items will never be removed, but the put_item method
# will replace old items if the hostnames are already associated with an old instance_id.
batch_writer.put_item(
Item={
"Id": nodename,
"InstanceId": instance.id,
"HeadNodePrivateIp": self._head_node_private_ip,
"HeadNodeHostname": self._head_node_hostname,
}
)