diff options
| author | Seth Vidal <skvidal@fedoraproject.org> | 2007-09-21 00:07:14 -0400 |
|---|---|---|
| committer | Seth Vidal <skvidal@fedoraproject.org> | 2007-09-21 00:07:14 -0400 |
| commit | 09564271ee24d4a6a9ff1aa09e52de33b7756985 (patch) | |
| tree | 8f70e7bf037b667e40dd5c2b6ef2ea75d1905222 /modules | |
| parent | 182953df4760b72e3b1b58e00ea1cfa93396d570 (diff) | |
| parent | b099654918b916ef256f09d628e02d11699536ea (diff) | |
| download | func-09564271ee24d4a6a9ff1aa09e52de33b7756985.tar.gz func-09564271ee24d4a6a9ff1aa09e52de33b7756985.tar.xz func-09564271ee24d4a6a9ff1aa09e52de33b7756985.zip | |
Merge branch 'master' of ssh://git.fedoraproject.org/git/hosted/func
* 'master' of ssh://git.fedoraproject.org/git/hosted/func:
Add trait_names for ipython's tab completion
Add reboot module
Diffstat (limited to 'modules')
| -rwxr-xr-x | modules/reboot.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/reboot.py b/modules/reboot.py new file mode 100755 index 0000000..72f9a24 --- /dev/null +++ b/modules/reboot.py @@ -0,0 +1,29 @@ +# Copyright 2007, Red Hat, Inc +# James Bowes <jbowes@redhat.com> +# +# This software may be freely redistributed under the terms of the GNU +# general public license. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + +from modules import web_svc + +import subprocess + +class Reboot(web_svc.WebSvc): + + def __init__(self): + self.methods = { + "reboot_reboot" : self.reboot + } + web_svc.WebSvc.__init__(self) + + def reboot(self, when='now', message=''): + return subprocess.call(["/sbin/shutdown", '-r', when, message]) + + +methods = Reboot() +register_rpc = methods.register_rpc |
