Opened 9 years ago

Closed 6 years ago

#2925 closed defect (fixed)

Fail early in r.modis.download when omitting folder

Reported by: pmav99 Owned by: grass-dev@…
Priority: normal Milestone: 7.0.7
Component: Addons Version: unspecified
Keywords: r.modis.download Cc:
CPU: Unspecified Platform: Unspecified

Description

According to r.modis.download documentation

By default, the downloaded files are stored in the path where the setting file is saved. The user can change this directory with folder option. The user has to set the folder option if user and password are sent by standard input.

If you specify the username/password from stdin and omit folder then you get the following traceback

r.modis.download settings=/home/grassuser/grassdata/modis/PERMANENT/.tmp/fa83d4fcd2cd/193.0 startday=2016-02-14 endday=2016-02-14
WARNING: Option 'tiles' not set. Downloading all available tiles
Traceback (most recent call last):
  File "/home/grassuser/.grass7/addons/scripts/r.modis.download", line 248, in <module>
    sys.exit(main())
  File "/home/grassuser/.grass7/addons/scripts/r.modis.download", line 227, in main
    modisOgg.connect()
  File "/home/grassuser/.grass7/addons/etc/r.modis/downmodis.py", line 311, in connect
    if len(self.dirData) == 0:
AttributeError: downModis instance has no attribute 'dirData'
(Wed Feb 17 16:45:04 2016) Command finished (11 min 17 sec)        

I think that it might make sense to add an early check instead of waiting for such a long time before aborting.

Change History (5)

comment:1 by martinl, 9 years ago

Milestone: 7.0.47.0.5

comment:2 by neteler, 8 years ago

Milestone: 7.0.57.0.6

in reply to:  description comment:3 by lucadelu, 8 years ago

Replying to pmav99:

According to r.modis.download documentation

By default, the downloaded files are stored in the path where the setting file is saved. The user can change this directory with folder option. The user has to set the folder option if user and password are sent by standard input.

If you specify the username/password from stdin and omit folder then you get the following traceback

r.modis.download settings=/home/grassuser/grassdata/modis/PERMANENT/.tmp/fa83d4fcd2cd/193.0 startday=2016-02-14 endday=2016-02-14
WARNING: Option 'tiles' not set. Downloading all available tiles
Traceback (most recent call last):
  File "/home/grassuser/.grass7/addons/scripts/r.modis.download", line 248, in <module>
    sys.exit(main())
  File "/home/grassuser/.grass7/addons/scripts/r.modis.download", line 227, in main
    modisOgg.connect()
  File "/home/grassuser/.grass7/addons/etc/r.modis/downmodis.py", line 311, in connect
    if len(self.dirData) == 0:
AttributeError: downModis instance has no attribute 'dirData'
(Wed Feb 17 16:45:04 2016) Command finished (11 min 17 sec)        

I think that it might make sense to add an early check instead of waiting for such a long time before aborting.

Sorry but I'm not able to reproduce the error.

Otherwise your example is using the settings so you are not using username/password from standard input

comment:4 by neteler, 7 years ago

Milestone: 7.0.67.0.7

comment:5 by lucadelu, 6 years ago

Resolution: fixed
Status: newclosed

Tested again for GUI, I cannot reproduce the error.

Closing.

Reopen if needed

Note: See TracTickets for help on using tickets.