Can you do:
```python
d["host"] = get_hostname(self.agentConfig)
```
and remove line 19.