Ejemplo n.º 1
0
    def do_select(self, object_name):
        "Select an MBean to perform operations on."

        if object_name:
            sanitized_name = object_name.strip().rstrip(',')

            try:
                object_name = ObjectName(sanitized_name)
            except MalformedObjectNameException, e:
                print "Failed to select MBean:", e.getLocalizedMessage()
                return

            if object_name.isPattern() or object_name.isDomainPattern():
                print "Silly goose, you can't select a pattern."
                return

            self.object_name = object_name