Code Monkey home page Code Monkey logo

Comments (18)

dellis23 avatar dellis23 commented on June 13, 2024

+1, this seems very basic and makes it hard to use the stat module without knowing what options are available.

from ansible-modules-core.

spanneberg avatar spanneberg commented on June 13, 2024

+1
Also the initial discussion at ansible/ansible#7457 shows that a lot of people would like to see that in the Ansible documentation.

from ansible-modules-core.

willharris avatar willharris commented on June 13, 2024

+1, what dellis23 said...

Also, missing from the list above:
checksum - the file's checksum (currently sha1) (added in Ansible 1.8)

from ansible-modules-core.

ardentperf avatar ardentperf commented on June 13, 2024

+1 agree, glad i found this link via google (wouldn't have had time to search python stat module)

from ansible-modules-core.

chicks-net avatar chicks-net commented on June 13, 2024

๐Ÿ‘ thanks for doing this! Hopefully it will make it into the real docs someday. ๐Ÿ‘

from ansible-modules-core.

dellis23 avatar dellis23 commented on June 13, 2024

For other folks that wind up here: none of these will be avalable if exists is False. So you can't just necessarily just test isdir for instance -- you have to test both result.stat.exists and result.stat.isdir.

from ansible-modules-core.

twekberg avatar twekberg commented on June 13, 2024

That is one of the few things that is present in the current stat documentation. You have to skip down to the examples section to find it.

"#...Note that we need to test

both that p.stat.isdir actually exists, and also that it's set to true."

from ansible-modules-core.

dellis23 avatar dellis23 commented on June 13, 2024

Ah I see:

p.stat.isdir is defined and p.stat.isdir

Unfortunately THAT DOESN'T MAKE IT OKAY!

:-)

from ansible-modules-core.

twekberg avatar twekberg commented on June 13, 2024

It sounds like you are suggesting is that these should be False when 'exists' is False:

isdir, ischr, isblk, isreg, isfifo, islnk, issock

The other stat values don't have meaning if exists is False. A change like that would be simple to make and backward compatible.

from ansible-modules-core.

dellis23 avatar dellis23 commented on June 13, 2024

Yeah, that sounds reasonable to me. Still, my overall point is that the documentation here is the biggest problem.

from ansible-modules-core.

bcoca avatar bcoca commented on June 13, 2024

so this is one documentation solution that is being proposed for all modules:
https://groups.google.com/forum/#!topic/ansible-devel/5OuTJXZWgvY

from ansible-modules-core.

chicks-net avatar chicks-net commented on June 13, 2024

I have been looking at doing some documentation patches for ansible and this is one I'd really like to see fixed, but the challenge of explaining how some of the variables show up some of the time and other times do not did not sound like a good time to me. ๐Ÿ˜ฑ If this were cleaned up as twekberg suggests it would make ansible much more useful and cause fewer nightmares for whoever actually gets it documented properly.

dellis23 said:
| Still, my overall point is that the documentation here is the biggest problem.

๐Ÿ‘ You are totally correct. The weak docs are a sad impediment for a project that seems to be so excellent otherwise.

@bcoca that sounds like a good direction to go.

from ansible-modules-core.

dellis23 avatar dellis23 commented on June 13, 2024

@bcoca I like that. (https://github.com/bcoca/ansible-modules-core/commit/9575cbc99f8ed43d37a54b47430a2b72e3e8c7ba is the commit, for anyone else).

from ansible-modules-core.

bcoca avatar bcoca commented on June 13, 2024

created 2 PRs #823 (now also documents stat module) and ansible/ansible#10295 implements the viewer in ansible-doc

from ansible-modules-core.

twekberg avatar twekberg commented on June 13, 2024

Forget about my 'backward compatible' comment on Feb 17. It isn't

from ansible-modules-core.

twekberg avatar twekberg commented on June 13, 2024

Bcoca: I reviewed the PR #823 and made some comments. Hopefully you got them.

from ansible-modules-core.

bcoca avatar bcoca commented on June 13, 2024

@twekberg already updated PR, check again

from ansible-modules-core.

bcoca avatar bcoca commented on June 13, 2024

closing via merged #823

from ansible-modules-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.