|
@@ -1073,6 +1073,7 @@ DEFAULTS = {
|
|
|
# defaults to 1 on Linux, and 0 otherwise
|
|
|
'sandbox': int(getenv_bool('CHUTNEY_TOR_SANDBOX',
|
|
|
platform.system() == 'Linux')),
|
|
|
+ 'num_cpus': None,
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1186,6 +1187,13 @@ class TorEnviron(chutney.Templating.Environ):
|
|
|
(my['nick'], e.errno, e.strerror, hs_hostname_file))
|
|
|
return my['hs-hostname']
|
|
|
|
|
|
+ def _get_num_cpus_line(self, my):
|
|
|
+ num_cpus = my['num_cpus']
|
|
|
+ num_cpus_line = 'NumCPUs {}'.format(num_cpus)
|
|
|
+ if num_cpus is None:
|
|
|
+ num_cpus_line = '#' + num_cpus_line
|
|
|
+ return num_cpus_line
|
|
|
+
|
|
|
def _get_owning_controller_process(self, my):
|
|
|
cpid = my['controlling_pid']
|
|
|
ocp_line = ('__OwningControllerProcess %d' % (cpid))
|