Esempio n. 1
0
    def update_node(self,node,**props):
        platform = props["platform"]
        if platform != "xen":
            raise Exception("Wrong platform %s found, while expecting %s" % \
                            (platform, "xen"))

        hostname = get_prop(props, "hostname")
        username = get_prop(props, "username", "root")
        password = get_prop(props, "password")
        use_keys = get_prop(props, "use_keys")
        address =  get_prop(props, "address")
        is_remote = get_prop(props, "is_remote", False)

        protocol = get_prop(props, "protocol", "tcp")
        tcp_port = get_prop(props, "tcp_port", 8006)
        ssh_port = get_prop(props, "ssh_port", 22)
        migration_port = get_prop(props, "migration_port", 8002)

        node.username=username
        node.password=password
        node.use_keys=use_keys
        node.address=address
        node.is_remote=is_remote
        node.ssh_port=ssh_port
        node.migration_port=migration_port
        node.protocol=protocol
        node.tcp_port=tcp_port

        node.set_node_credentials("",ssh_port = ssh_port,username = username,\
                                    password = password,use_keys = use_keys)
                                    
        return node
Esempio n. 2
0
    def create_node(self, **props):
        # validate input
        keys = props.keys()
        missing = []
        for k in ('hostname', ):
            if k not in keys:
                missing.append(k)

        if len(missing) > 0:
            raise Exception("Missing properties " + to_str(missing))

        platform = props["platform"]
        if platform != "kvm":
            raise Exception("Wrong platform %s found, while expecting %s" % \
                            (platform, "kvm"))
        

        # use defaults
        if self.config : # see base class
            pass # pick up some defaults from here.


        # here some hard coded ones.
        hostname = get_prop(props, "hostname")
        username = get_prop(props, "username", "root")
        password = get_prop(props, "password")
        use_keys = get_prop(props, "use_keys")
        address =  get_prop(props, "address")
        is_remote = get_prop(props, "is_remote", False)
        
        ssh_port = get_prop(props, "ssh_port", 22)
        migration_port = get_prop(props, "migration_port", 8002)


        # construct and return object
        node = KVMNode( hostname = hostname,
                        username= username,
                        password= password,
                        isRemote= is_remote,
                        ssh_port = ssh_port,
                        migration_port = migration_port, 
                        helper = None,
                        #store = self.store,
                        use_keys = use_keys,
                        address = address)

        return node
Esempio n. 3
0
    def create_node(self, **props):
        # validate input
        keys = props.keys()
        missing = []
        for k in ('hostname', ):
            if k not in keys:
                missing.append(k)

        if len(missing) > 0:
            raise Exception("Missing properties " + to_str(missing))

        platform = props["platform"]
        if platform != "kvm":
            raise Exception("Wrong platform %s found, while expecting %s" % \
                            (platform, "kvm"))

        # use defaults
        if self.config:  # see base class
            pass  # pick up some defaults from here.

        # here some hard coded ones.
        hostname = get_prop(props, "hostname")
        username = get_prop(props, "username", "root")
        password = get_prop(props, "password")
        use_keys = get_prop(props, "use_keys")
        address = get_prop(props, "address")
        is_remote = get_prop(props, "is_remote", False)

        ssh_port = get_prop(props, "ssh_port", 22)
        migration_port = get_prop(props, "migration_port", 8002)

        # construct and return object
        node = KVMNode(
            hostname=hostname,
            username=username,
            password=password,
            isRemote=is_remote,
            ssh_port=ssh_port,
            migration_port=migration_port,
            helper=None,
            #store = self.store,
            use_keys=use_keys,
            address=address)

        return node