Exemplo n.º 1
0
    def validate(self):
        super().validate()
        persist = self.parameters.get("persistent_nfs")
        if not persist:
            return
        if "address" not in persist:
            self.errors = "Missing address for persistent NFS"
            return
        if ":" not in persist["address"]:
            self.errors = ("Unrecognised NFS URL: '%s'" %
                           self.parameters["persistent_nfs"]["address"])
            return
        nfs_server, dirname = persist["address"].split(":")
        which("rpcinfo")
        self.errors = rpcinfo_nfs(nfs_server)
        self.set_namespace_data(action=self.name,
                                label="nfs_address",
                                key="nfsroot",
                                value=dirname)
        self.set_namespace_data(action=self.name,
                                label="nfs_address",
                                key="serverip",
                                value=nfs_server)

        self.job.device["dynamic_data"]["NFS_ROOTFS"] = dirname
        self.job.device["dynamic_data"]["NFS_SERVER_IP"] = nfs_server
Exemplo n.º 2
0
 def validate(self):
     super(PersistentNFSOverlay, self).validate()
     persist = self.parameters.get('persistent_nfs', None)
     if not persist:
         return
     if 'address' not in persist:
         self.errors = "Missing address for persistent NFS"
         return
     if ':' not in persist['address']:
         self.errors = "Unrecognised NFS URL: '%s'" % self.parameters['persistent_nfs']['address']
         return
     nfs_server, dirname = persist['address'].split(':')
     which('rpcinfo')
     self.errors = rpcinfo_nfs(nfs_server)
     self.set_namespace_data(action=self.name, label='nfs_address', key='nfsroot', value=dirname)
     self.set_namespace_data(action=self.name, label='nfs_address', key='serverip', value=nfs_server)