Skip to content

Comments

RFC: Module cleanups#359

Merged
thatch45 merged 16 commits intosaltstack:developfrom
SEJeff:module-cleanups
Dec 15, 2011
Merged

RFC: Module cleanups#359
thatch45 merged 16 commits intosaltstack:developfrom
SEJeff:module-cleanups

Conversation

@SEJeff
Copy link
Contributor

@SEJeff SEJeff commented Dec 15, 2011

This branch has a bunch of cleanups for personal coding style nits, some pep8, fixing bugs, and adding features. I've not had time to go over each and every module just yet or finish everything. However, this would be a pain to rebase if it starts getting merge conflicts so upstream ahoy!

PLEASE SCRUTINIZE THIS PATCH SERIES - it touches a lot of code

A few more cleanups that will come at a later time

  • more friendly error messages
  • consistency where necessary
  • merge the cleverness from apache.signal and solr.signal
  • a custom traceback when a command isn't found inside a module to pretty-print an error
  • create cmd._run to abstract the several nearly identical subprocess calls and have them all use one function

    - grains.item and grains.list are now shorter
    - grains.item can be called without an argument and won't barf
It overrides a python builtin
    - Add outputters for dig and netstat
    - Remove a pointless check from network.netstat()
    - The network module doesn't work in Ubuntu 10.10
    - The traceroute module doesn't work in Ubuntu 10.10
For cron.list_jobs and cron.rm_tab. This just keeps things a bit
consistent and more obvious to any 'nix geek who happenst to look
Previously, disk.usage was returning a dictionary where the key was in
the "Filesystem" column. It seemed proper to return every  filesystem,
even the virtual ones so the dict key was changed to  the  mountpoint.

$ df -P
Filesystem         1024-blocks      Used Available Capacity Mounted on
/dev/sda8            177822980  12504764 156285272       8% /
none                   6154104       312   6153792       1% /dev
none                   6161372      3736   6157636       1% /dev/shm
none                   6161372       336   6161036       1% /var/run
none                   6161372         0   6161372       0% /var/lock
/dev/sda1               101086     85423     15663      85% /boot
/dev/sda5            240308484 219822840  20485644      92% /home
/dev/sda7             54791132   1104204  50903672       3% /var

This can be changed to skip anything that has a Filesystem of none
down the road, but I don't have any non-Linux hosts  to  test  on.
As part of this branch, I'm trying to read through most all of the
modules and clean things up. This is small, and might not normally
warrant a commit, but I'm trying to keep things  easy  to  bisect.
    - Add apache.signal text outputter
    - Add the following signals: status, fullstatus, configtest
    - Lots of style cleanups to fit better with the rest of salt
    - Output information about what happened when signals are ran
This patch is a function noop, but makes the code easier to read
thatch45 added a commit that referenced this pull request Dec 15, 2011
@thatch45 thatch45 merged commit 8be963f into saltstack:develop Dec 15, 2011
agraul pushed a commit to agraul/salt that referenced this pull request Jun 25, 2021
twangboy pushed a commit to twangboy/salt that referenced this pull request Apr 20, 2022
[3002.9] Update the ftp url in the cp tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants