{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/107","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/107/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/107/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/107","id":44582925,"number":107,"title":"stat module documentation","user":{"login":"twekberg","id":1850934,"avatar_url":"https://avatars.githubusercontent.com/u/1850934?v=3","gravatar_id":"","url":"https://api.github.com/users/twekberg","html_url":"https://github.com/twekberg","followers_url":"https://api.github.com/users/twekberg/followers","following_url":"https://api.github.com/users/twekberg/following{/other_user}","gists_url":"https://api.github.com/users/twekberg/gists{/gist_id}","starred_url":"https://api.github.com/users/twekberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twekberg/subscriptions","organizations_url":"https://api.github.com/users/twekberg/orgs","repos_url":"https://api.github.com/users/twekberg/repos","events_url":"https://api.github.com/users/twekberg/events{/privacy}","received_events_url":"https://api.github.com/users/twekberg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/docs_report","name":"docs_report","color":"0052cc"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-10-01T16:11:31Z","updated_at":"2015-02-17T18:10:30Z","closed_at":null,"body":"##### Issue Type:\r\n\r\nWhat kind of ticket is this? “Documentation Report”\r\n\r\n##### Ansible Version:\r\n\r\n1.7.2 development\r\n\r\n##### Environment:\r\n\r\nWhat OS are you running Ansible from and what OS are you managing? Ubuntu 12.04\r\n\r\n##### Summary:\r\n\r\nThe stat module exposes many attributes available via the stat function in the Python os module, and some additional attributes. These attributes should be mentioned in the documentation of the stat module. The attributes pw_name and isdir were used in the examples. I had to go to the source for the stat module to find the other attributes.\r\n\r\nHere is what I would like to see added to the end of ansible/library/files/stat's DOCUMENTATION string. The only ones that I'm unsure about are pw_name, isgid and isuid.\r\n\r\nreturns: a stat object with the following attributes:\r\natime - last access time\r\nctime - last creation time\r\ndev - path's device\r\nexists - true if the file exists\r\ngid - path's group id\r\ninode - path's inode\r\nisblk - true if path is a block device\r\nischr - true if path is a character device\r\nisdir - true if path is a directory\r\nisfifo - true if path is a fifo (a.k.a. named pipe)\r\nisgid - invoking group's id matches path's group id\r\nislnk - true if path is a symbolic link\r\nisreg - true if path is a regular file\r\nissock - true if path is a socket (a.k.a. UNIX Domain Socket)\r\nisuid - invoking user's id matches path's user id\r\nlnk_source - where path links to\r\nmd5 - md5 checksum for path\r\nmode - the mode of path in 4 octal digits\r\nmtime - last modification time\r\nnlink - number of hard links to this path\r\npw_name - owner of path\r\nrgrp - path mode: group read\r\nroth - path mode: other read\r\nrusr - path mode: user read\r\nsize - size of path\r\nuid - path's user id\r\nwgrp - path mode: group write\r\nwoth - path mode: other write\r\nwusr - path mode: user write\r\nxgrp - path mode: group execute\r\nxoth - path mode: other execute\r\nxusr - path mode: user execute\r\n\r\n##### Steps To Reproduce:\r\n\r\nLook at the stat module's documentation.\r\n\r\n##### Expected Results:\r\n\r\nMore detail in the documentation without having to look at the stat module's source code.\r\n\r\n##### Actual Results:\r\n\r\nN/A\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/74718899","html_url":"https://github.com/ansible/ansible-modules-core/issues/107#issuecomment-74718899","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/107","id":74718899,"user":{"login":"twekberg","id":1850934,"avatar_url":"https://avatars.githubusercontent.com/u/1850934?v=3","gravatar_id":"","url":"https://api.github.com/users/twekberg","html_url":"https://github.com/twekberg","followers_url":"https://api.github.com/users/twekberg/followers","following_url":"https://api.github.com/users/twekberg/following{/other_user}","gists_url":"https://api.github.com/users/twekberg/gists{/gist_id}","starred_url":"https://api.github.com/users/twekberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twekberg/subscriptions","organizations_url":"https://api.github.com/users/twekberg/orgs","repos_url":"https://api.github.com/users/twekberg/repos","events_url":"https://api.github.com/users/twekberg/events{/privacy}","received_events_url":"https://api.github.com/users/twekberg/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T18:10:30Z","updated_at":"2015-02-17T18:10:30Z","body":"It sounds like you are suggesting is that these should be False when 'exists' is False:\r\n\r\n    isdir, ischr, isblk, isreg, isfifo, islnk, issock\r\n\r\nThe other stat values don't have meaning if exists is False. A change like that would be simple to make and backward compatible."}}