Object conflict where there should not be one - or wrong error message #108
Labels
No labels
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#108
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: telmich
Created by: darko-poljak
But, argparse resolves param as list and list != tuple :)
Created by: darko-poljak
@telmich Although I think reading should return tuple instead of list, an unmodifiable sequence type. Do you agree?
Created by: darko-poljak
/home/darko/.cdist/manifest/test: {'state': 'present', 'config': 'ungleich\nungleich2'}
/home/darko/.cdist/manifest/test: {'state': 'present', 'config': ['ungleich', 'ungleich2']}
Created by: darko-poljak
@telmich
Created by: darko-poljak
@telmich Randomly chosen 4.0 branch.
Created by: telmich
Is this something that we recently changed? Because the above manifest did run without changes some time ago, I claim
Created by: darko-poljak
@telmich Something like the following:
Created by: darko-poljak
@telmich It is reproduced easily with the following init manifest:
It seems that DirectoryDict does not work as it should for multiple parameters, config can be specified multiple times.
When it reads multiple parameter from file it returns file content with last \n stripped.
But when it writes multiple parameters it detects if value is a sequence.
If parameter is not multiple then file content is always one line, right?
Then when reading value in DirectoryDict we should try to split read content by \n, and if there is more then one value then we should return a list.
See the following output (additional print added to source code) for init manifest:
Created by: darko-poljak
@telmich
{'config': 'ungleich', 'state': 'present'}
vs{'config': ['ungleich'], 'state': 'present'}
. The question is why list in the second one.Created by: telmich
@darko-poljak ping
Created by: telmich
manifest/dcl: __ungleich_monit ungleich --config ungleich
type/__dcl_ceph: __ungleich_monit ungleich --config ungleich