Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

salt.utils.etcd_util emits an EtcdNotFile error (emits not a file to logs) when creating a directory (because it's not a file) #51537

Closed
arizvisa opened this issue Feb 7, 2019 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior P3 Priority 3 severity-low 4th level, cosemtic problems, work around exists
Milestone

Comments

@arizvisa
Copy link
Contributor

arizvisa commented Feb 7, 2019

Description of Issue/Question

salt.utils.etcd_util doesn't properly distinguish between creating directories and files. When creating a directory with etcd.directory (or anything else), salt.utils.etcd_util stupidly outputs "$path not a file".

Setup

Setup etcd somewhere.

Steps to Reproduce Issue

Simply call etcd.directory on a directory that already exists.

Versions Report

All of them, nobody seems to use etcd.

Report

The issue is that all writes to etcd have been funnelled into a method off of the salt.utils.etcd_util.EtcdClient object. This method, .write(), takes a parameter dir to distinguish between whether to reset value to None or not and is later used to distinguish between the property types.

This is fine, but when an exception is raised, the method does not bother to distinguish between the types of exceptions and thus an exception used to distinguish when a key exists (which occurs when applying states) an error gets passed through.

@arizvisa
Copy link
Contributor Author

arizvisa commented Feb 7, 2019

This is closed by #51538

@arizvisa
Copy link
Contributor Author

arizvisa commented Feb 7, 2019

(whenever that gets merged that is). Sorry, phrased that prior comment in the wrong tense.

@dwoz
Copy link
Contributor

dwoz commented Feb 8, 2019

@arizvisa Thanks so much for reporting the issue and for the PR!

@dwoz dwoz added Bug broken, incorrect, or confusing behavior P3 Priority 3 severity-low 4th level, cosemtic problems, work around exists labels Feb 8, 2019
@dwoz dwoz added this to the Approved milestone Feb 8, 2019
@arizvisa
Copy link
Contributor Author

Closing this as it was fixed by PR #51538.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior P3 Priority 3 severity-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

No branches or pull requests

2 participants