Giter Club home page Giter Club logo

arsa's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

arsa's Issues

Idea: prompt user for login information if no shell variables given

Red Hat Portal user "Remmele" had the idea to prompt the user for login information: https://access.redhat.com/site/discussions/874773

Passing the login information using shell variables can be a security problem unless you're dropping shell history support for your command:

HISTFILE="" SATELLITE_LOGIN=mylogin SATELLITE_PASSWORD=mypass ./arsa.py -l

Another idea is to also implement username/password files (with permissions 0600) - the script could also read the credentials from that file.

Actions are deleted sequentially

Actions are currently deleted sequentially which can cause problems if you're deleting a lot of actions (due to flooding).

As the Spacewalk API call schedule.deleteActions() also supports deleting multiple actions it would be better to create one deletion request including all the action IDs.

Cleanup only system tasks

Here´s a diff to allow only system tasks to be archived/deleted. This is very useful if you need only to make thinkgs softer but care for the history of Satellite.
arsa.diff.txt

Parameter for ignoring API support

Currently, I need to alter the toolkit after every new release of Spacewalk. It would useful to have a parameter to ignore API level validation as I might not find much time for maintaining this toolkit, anymore. :)

Archive/Delete in chunks? 500 Internal Server Error

When I try to run arsa.py, we run into a problem:

[root@ft-spacewalk arsa]# python arsa.py 
Username: myusername
Password: 
Found completed action #52972 ('Show differences between profiled config files and deployed config files')...
Found completed action #52971 ('Show differences between profiled config files and deployed config files')...
Found completed action #52970 ('Show differences between profiled config files and deployed config files')...
Found completed action #52969 ('Show differences between profiled config files and deployed config files')...
(snip)
Found archived action #63063 ('Show differences between profiled config files and deployed config files')...
Found archived action #63062 ('Show differences between profiled config files and deployed config files')...
Archiving actions...
Enabling workaround to archive/delete more than 100 actions...
[65536, 65541, 65543, 65547, 65548, 65553, 65554, 65558, 65559, 65565, 65566, 65570, 65571, 65574, 65576, 65577, 65583, 65584, 65588, 65589, 65590, 65592, 65595, 65601, 65604, 65607, 65613, 65614, 65618, 65619, 65623, 65625, 65631, 65634, 32868, 65637, 65643, 65644, 65648, 65649, 65655, 65661, 
(snip)
72211, 71446, 71447]
Traceback (most recent call last):
  File "arsa.py", line 152, in <module>
    client.schedule.deleteActions(key,tempActions)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1243, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for localhost/rpc/api: 500 Internal Server Error>
  • There are ~5400 entries in the array. I had already archived like 30,0000 through the GUI ;)

Perhaps there are WAY more in the "archive" ? I am deleting them 10,000 at a time through the webUI for now, hopefully we can setup arsa.py to run periodically and not get into this state again :)

I think the problem was encountered during the "delete" step rather than the archive step, where there was ~55,000 entries in my archive (unless I lost count deleting them 10k at a time through the browser)

Use logger functionality

It would be better to use a logger instead of manual printing messages if debug mode is enabled.

Optimize code structure

Currently the whole code is implemented in main() - it would be better to create functions to optimize readability.

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.