Skip to content

Commit

Permalink
Use set_option None for unset_option
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Sep 1, 2023
1 parent fcce627 commit ebecd36
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
2 changes: 0 additions & 2 deletions src/clib/lib/include/ert/job_queue/queue_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ queue_driver_get_name(const queue_driver_type *driver);
extern "C" bool queue_driver_set_option(queue_driver_type *driver,
const char *option_key,
const void *value);
extern "C" bool queue_driver_unset_option(queue_driver_type *driver,
const char *option_key);
extern "C" const void *queue_driver_get_option(queue_driver_type *driver,
const char *option_key);
void queue_driver_init_option_list(queue_driver_type *driver,
Expand Down
8 changes: 0 additions & 8 deletions src/clib/lib/job_queue/queue_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@ bool queue_driver_set_option(queue_driver_type *driver, const char *option_key,
}
}

/**
Unset the given option. If the option cannot be unset, it is restored to its default value.
*/
bool queue_driver_unset_option(queue_driver_type *driver,
const char *option_key) {
return queue_driver_set_option(driver, option_key, NULL);
}

/**
Observe that after the driver instance has been allocated it does
NOT support modification of the common fields, only the data owned
Expand Down
3 changes: 1 addition & 2 deletions src/ert/job_queue/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class Driver(BaseCClass): # type: ignore
_alloc = ResPrototype("void* queue_driver_alloc( queue_driver_enum )", bind=False)
_free = ResPrototype("void queue_driver_free( driver )")
_set_option = ResPrototype("void queue_driver_set_option( driver , char* , char*)")
_unset_option = ResPrototype("void queue_driver_unset_option( driver , char*)")
_get_option = ResPrototype("char* queue_driver_get_option(driver, char*)")
_get_name = ResPrototype("char* queue_driver_get_name( driver )")

Expand All @@ -38,7 +37,7 @@ def set_option(self, option: str, value: str) -> bool:
return self._set_option(option, str(value))

def unset_option(self, option: str) -> None:
return self._unset_option(option)
return self._set_option(option, None)

def get_option(self, option_key: str) -> str:
if option_key == "MAX_RUNNING":
Expand Down

0 comments on commit ebecd36

Please sign in to comment.