4 Copyright 2007, Red Hat, Inc
7 This software may be freely redistributed under the terms of the GNU
8 general public license.
10 You should have received a copy of the GNU General Public License
11 along with this program; if not, write to the Free Software
12 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 from func
.overlord
import command
20 from func
.overlord
import client
23 class ListMinions(client
.command
.Command
):
25 usage
= "show known minions"
28 self
.parser
.add_option("-v", "--verbose", dest
="verbose",
31 def handleOptions(self
, options
):
32 self
.port
= DEFAULT_PORT
34 self
.verbose
= self
.options
.verbose
37 self
.server_spec
= self
.parentCommand
.server_spec
39 client_obj
= client
.Client(self
.server_spec
,
42 verbose
=self
.options
.verbose
,
45 servers
= client_obj
.servers
47 for server
in servers
:
48 # just cause I hate regex'es -akl
49 host
= server
.split(':')[-2]
50 host
= host
.split('/')[-1]