Hey everyone,
I appreciate the help. I am learning to script out the creation of a task and am working on creating the schedules. When I select a period_unit I am given an error. I have tried every variation of the word “week” and it still throws an error.
>>> gmp.create_schedule(name='TestSchedule',first_time_hour=5,first_time_minute=1,first_time_month=5,first_time_day_of_month=15,first_time_year=2020,period=1,period_unit='WEEK')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/gvm/protocols/gmpv7/__init__.py", line 1663, in create_schedule
arg_type=TimeUnit.__name__,
gvm.errors.InvalidArgumentType: In create_schedule the argument period_unit must be of type TimeUnit.
>>> gmp.create_schedule(name='TestSchedule',first_time_hour=5,first_time_minute=1,first_time_month=5,first_time_day_of_month=15,first_time_year=2020,period=1,period_unit=WEEK)
Traceback (most recent call last):
File "<console>", line 1, in <module>
NameError: name 'WEEK' is not defined
>>> gmp.create_schedule(name='TestSchedule',first_time_hour=5,first_time_minute=1,first_time_month=5,first_time_day_of_month=15,first_time_year=2020,period=1,period_unit='WEEK')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/gvm/protocols/gmpv7/__init__.py", line 1663, in create_schedule
arg_type=TimeUnit.__name__,
gvm.errors.InvalidArgumentType: In create_schedule the argument period_unit must be of type TimeUnit.
>>> gmp.create_schedule(name='TestSchedule',first_time_hour=5,first_time_minute=1,first_time_month=5,first_time_day_of_month=15,first_time_year=2020,period=1,period_unit=gmp.week)
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'Gmp' object has no attribute 'week'
>>> gmp.create_schedule(name='TestSchedule',first_time_hour=5,first_time_minute=1,first_time_month=5,first_time_day_of_month=15,first_time_year=2020,period=1,period_unit='week')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/gvm/protocols/gmpv7/__init__.py", line 1663, in create_schedule
arg_type=TimeUnit.__name__,
gvm.errors.InvalidArgumentType: In create_schedule the argument period_unit must be of type TimeUnit.
Thank you very much in advance!