def ConstructNfsService(self):
    """Construct the NFS service object.

    Creates an NFS Service only if an NFS disk is found in the disk_specs.
    """
    if self.nfs_service:
      logging.info('NFS service already created: %s', self.nfs_service)
      return
    for group_spec in self.vms_to_boot.values():
      if not group_spec.disk_spec or not group_spec.vm_count:
        continue
      disk_spec = group_spec.disk_spec
      if disk_spec.disk_type != disk.NFS:
        continue
      # Choose which nfs_service to create.
      if disk_spec.nfs_ip_address:
        self.nfs_service = nfs_service.StaticNfsService(disk_spec)
      elif disk_spec.nfs_managed:
        cloud = group_spec.cloud
        providers.LoadProvider(cloud)
        nfs_class = nfs_service.GetNfsServiceClass(cloud)
        self.nfs_service = nfs_class(disk_spec, group_spec.vm_spec.zone)
      else:
        self.nfs_service = nfs_service.UnmanagedNfsService(disk_spec,
                                                           self.vms[0])
      logging.debug('NFS service %s', self.nfs_service)
      break
 def setUp(self):
   super(UnmanagedNfsServiceTest, self).setUp()
   self._setUpDiskSpec()
   self._setUpMockServerVm()
   self.nfs_service = nfs_service.UnmanagedNfsService(self.disk_spec,
                                                      self.mock_server_vm)