diff --git a/geospaas/nansat_ingestor/management/commands/ingest.py b/geospaas/nansat_ingestor/management/commands/ingest.py index b1732881..76251c5d 100644 --- a/geospaas/nansat_ingestor/management/commands/ingest.py +++ b/geospaas/nansat_ingestor/management/commands/ingest.py @@ -44,6 +44,8 @@ def _get_args(self, *args, **options): def handle(self, *args, **options): """ Ingest one Dataset per file that has not previously been ingested """ + print("WARNING!!! nansat_ingestor app will be deprecated soon and no longer " + "accessible. Please use `LOCALHarvester` of geospaas harvesting package instead.") non_ingested_uris, n_points, nansat_options = self._get_args(*args, **options) for non_ingested_uri in non_ingested_uris: diff --git a/geospaas/nansat_ingestor/management/commands/ingest_hyrax.py b/geospaas/nansat_ingestor/management/commands/ingest_hyrax.py index 8edb27dc..a418f45a 100644 --- a/geospaas/nansat_ingestor/management/commands/ingest_hyrax.py +++ b/geospaas/nansat_ingestor/management/commands/ingest_hyrax.py @@ -13,6 +13,8 @@ class Command(IngestCommand): help = 'Add file to catalog from HYRAX server' def handle(self, *args, **options): + print("WARNING!!! nansat_ingestor app will be deprecated soon and no longer " + "accessible. Please use `LOCALHarvester` of geospaas harvesting package instead.") print('Searching netcdf files. May take some time...\n\n\n') nc_uris = find_netcdf_uris(args[0]) num_nc_uris = len(nc_uris) @@ -42,5 +44,3 @@ def find_netcdf_uris(uri0, sleep=1.0): print('Server error %s'%e.message) # return all links to netCDF return nc_uris - - diff --git a/geospaas/nansat_ingestor/management/commands/ingest_thredds_crawl.py b/geospaas/nansat_ingestor/management/commands/ingest_thredds_crawl.py index cb7069e5..4e94e2fe 100644 --- a/geospaas/nansat_ingestor/management/commands/ingest_thredds_crawl.py +++ b/geospaas/nansat_ingestor/management/commands/ingest_thredds_crawl.py @@ -89,6 +89,8 @@ def add_arguments(self, parser): help='''Filename of a specific dataset''') def handle(self, *args, **options): + print("WARNING!!! nansat_ingestor app will be deprecated soon and no longer " + "accessible. Please use `LOCALHarvester` of geospaas harvesting package instead.") if not len(options['url']) == 1: raise IOError('Please provide a url to the data') url = options.pop('url')[0] diff --git a/geospaas/nansat_ingestor/tests.py b/geospaas/nansat_ingestor/tests.py index 616ad1c2..cfa80ca5 100644 --- a/geospaas/nansat_ingestor/tests.py +++ b/geospaas/nansat_ingestor/tests.py @@ -238,20 +238,20 @@ def test_ingest_no_args(self): with captured_output() as (out, err): call_command('ingest_thredds_crawl', self.uri) output = out.getvalue().strip() - self.assertEqual(output, 'Successfully added metadata of 10 datasets') + self.assertEqual(output, 'WARNING!!! nansat_ingestor app will be deprecated soon and no longer accessible. Please use `LOCALHarvester` of geospaas harvesting package instead.\nSuccessfully added metadata of 10 datasets') def test_ingest_with_year_arg(self): with captured_output() as (out, err): call_command('ingest_thredds_crawl', self.uri, date=['2019/01/24']) output = out.getvalue().strip() - self.assertEqual(output, 'Successfully added metadata of 10 datasets') + self.assertEqual(output, 'WARNING!!! nansat_ingestor app will be deprecated soon and no longer accessible. Please use `LOCALHarvester` of geospaas harvesting package instead.\nSuccessfully added metadata of 10 datasets') def test_ingest_with_filename_arg(self): with captured_output() as (out, err): call_command('ingest_thredds_crawl', self.uri, filename='S2A_MSIL1C_20190124T115401_N0207_R023_T30VWP_20190124T120414.nc') output = out.getvalue().strip() - self.assertEqual(output, 'Successfully added metadata of 10 datasets') + self.assertEqual(output, 'WARNING!!! nansat_ingestor app will be deprecated soon and no longer accessible. Please use `LOCALHarvester` of geospaas harvesting package instead.\nSuccessfully added metadata of 10 datasets') class TestIngestThreddsCrawl__crawl__function(TestCase): diff --git a/geospaas/tests.py b/geospaas/tests.py index bbbf3274..55a26d8f 100644 --- a/geospaas/tests.py +++ b/geospaas/tests.py @@ -6,13 +6,6 @@ from geospaas.utils import utils class TestUtils(TestCase): - @patch('urllib3.PoolManager') - def test_validate_uri_opendap_does_not_exist(self, mock_PoolManager): - uri = 'http://www.ifremer.fr' - mock_PoolManager.status=1 - with self.assertRaises(OSError) as cm: - utils.validate_uri(uri) - self.assertEqual('NetCDF: file not found', cm.exception.args[1]) @patch('geospaas.utils.utils.os.path.isfile') def test_validate_uri_local(self, mock_isfile):