Azure / Azure/azure-iot-hub-python
Deployment configuration updates fail when using IoTHubConfigurationManager.update_configuration
- Lingua principale
- Python
- Stelle
- 18
- Fork
- 24
- Merge medio
- 3g 23h
- PR unite (30g)
- 1
Descrizione
# Context
- **OS and version used:** MacOS 11.6.4
- **Python version:** 3.7.5
- **pip version:** 20.2.3
- **list of installed packages:** azure-iot-hub 2.6.0
## Description of the issue
It is not possible to update a device configuration using IoTHubConfigurationManager.update_configuration. All requests result in `Operation returned an invalid status code 'Conflict'`. In the code example below, I retrieve an existing configuration, change the target_condition and then attempt to update it.
## Code sample exhibiting the issue
```
from msrest.exceptions import HttpOperationError
from azure.iot.hub import IoTHubConfigurationManager
config_service = IoTHubConfigurationManager(iothub_conn_str)
# retrieve an existing deployment
current_config = config_service.get_configuration("my_deployment")
print(current_config)
# change the target condition
current_config.target_condition = "tags.environment='test'"
try:
config_service.update_configuration(current_config, current_config.etag)
except HttpOperationError as ex:
print(ex)
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Start with IoTHubConfigurationManager.update_configuration and compare its request with get_configuration, using the provided reproduction and the returned etag. Investigate why changing target_condition produces Conflict; done means an existing deployment can be updated successfully and the regression is verified against this scenario.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, python
- Ambito
- api, backend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100