Skip to content

Commit c056bfa

Browse files
committed
code feedback changes
1 parent 0893bb8 commit c056bfa

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

CONFIGURATION.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ git push
261261

262262
Name files descriptively:
263263

264-
```
264+
```text
265265
dev-machine-john.yaml
266266
production-web-server.yaml
267267
ml-training-gpu-rig.yaml
@@ -313,7 +313,7 @@ python3 config_manager.py export \
313313

314314
Maintain separate configs for different environments:
315315

316-
```
316+
```text
317317
configs/
318318
├── development.yaml
319319
├── staging.yaml
@@ -417,7 +417,10 @@ result = manager.import_configuration(
417417
dry_run=True
418418
)
419419

420-
# Check diff
420+
# Check diff - load the config file first
421+
import yaml
422+
with open('config.yaml', 'r') as f:
423+
config = yaml.safe_load(f)
421424
diff = manager.diff_configuration(config)
422425
print(f"To install: {len(diff['packages_to_install'])}")
423426
```
@@ -579,9 +582,9 @@ Cortex Linux Configuration Management is part of the Cortex Linux project.
579582

580583
## Support
581584

582-
- **Issues**: https://github.com/cortexlinux/cortex/issues
583-
- **Discord**: https://discord.gg/uCqHvxjU83
584-
- **Email**: mike@cortexlinux.com
585+
- **Issues**: [https://github.com/cortexlinux/cortex/issues](https://github.com/cortexlinux/cortex/issues)
586+
- **Discord**: [https://discord.gg/uCqHvxjU83](https://discord.gg/uCqHvxjU83)
587+
- **Email**: [mike@cortexlinux.com](mailto:mike@cortexlinux.com)
585588

586589
---
587590

src/config_manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ def import_configuration(self,
581581
summary = {
582582
'installed': [],
583583
'upgraded': [],
584+
'downgraded': [],
584585
'failed': [],
585586
'skipped': [],
586587
'preferences_updated': False
@@ -638,6 +639,8 @@ def _import_packages(self, config: Dict[str, Any], summary: Dict[str, Any]) -> N
638639
if success:
639640
if pkg in diff['packages_to_install']:
640641
summary['installed'].append(pkg['name'])
642+
elif pkg in diff['packages_to_downgrade']:
643+
summary['downgraded'].append(pkg['name'])
641644
else:
642645
summary['upgraded'].append(pkg['name'])
643646
else:
@@ -888,6 +891,8 @@ def main():
888891
print(f"📦 Installed: {len(result['installed'])} packages")
889892
if result['upgraded']:
890893
print(f"⬆️ Upgraded: {len(result['upgraded'])} packages")
894+
if result.get('downgraded'):
895+
print(f"⬇️ Downgraded: {len(result['downgraded'])} packages")
891896
if result['failed']:
892897
print(f"❌ Failed: {len(result['failed'])} packages")
893898
for pkg in result['failed']:

0 commit comments

Comments
 (0)