qontract-reconcile
raw JSON → 0.10.1 verified Sat May 09 auth: no python
A collection of tools to reconcile the state of services with their desired state defined in app-interface, typically used in Service Delivery Platforms and configuration management. Current version 0.10.1. Releases follow an unpredictable cadence driven by internal Red Hat needs.
pip install qontract-reconcile Common errors
error ModuleNotFoundError: No module named 'reconcile' ↓
cause Package not installed or Python environment misconfigured.
fix
Run: pip install qontract-reconcile
error ImportError: cannot import name 'ReconcileIntegration' from 'reconcile' ↓
cause Using a cross-version release where the class was not yet introduced, or wrong import path.
fix
Use: from reconcile.utils.integration import ReconcileIntegration
error TypeError: Can't instantiate abstract class MyIntegration with abstract methods reconcile ↓
cause The reconcile method is not implemented in the user's integration class.
fix
Implement the reconcile(self, dry_run: bool) -> None method.
Warnings
breaking Python 3.11+ only. Older versions will fail with syntax/import errors. ↓
fix Use Python 3.11 or later.
deprecated The old 'reconcile/<integration>.py' module pattern is deprecated in favor of the ReconcileIntegration class-based approach. ↓
fix Migrate to class-based integrations defined in reconcile.utils.integration.
gotcha Many integrations require an app-interface secret or environment variable (e.g., INTEGRATION_EXTRA_ARGS). The CLI dry-run flag is not always enough to skip all side effects. ↓
fix Set DRY_RUN=true or pass --dry-run; consult app-interface docs for each integration's expectations.
Install
pip install qontract-reconcile[integrations] Imports
- ReconcileIntegration wrong
from reconcile import ReconcileIntegrationcorrectfrom reconcile.utils.integration import ReconcileIntegration - run_integration wrong
from reconcile import run_integrationcorrectfrom reconcile.utils.integration import run_integration
Quickstart
import os
from reconcile.utils.integration import ReconcileIntegration, run_integration
class MyIntegration(ReconcileIntegration):
@property
def name(self) -> str:
return "my-integration"
def reconcile(self, dry_run: bool) -> None:
print(f"Reconciling (dry_run={dry_run})")
if __name__ == "__main__":
run_integration(MyIntegration())