Change run-iperf action total-run-time to seconds
Previously it was in minutes, which didn't allow finer control as desired. Also unconditionally install the iperf apt package in the charm, because it should always be available for the case where the user wants to run the run-iperf action, but not auto-running iperf (ie. check_iperf=False). Change-Id: I032be1d29dcb3dcf051e79e96e849e471cbde2ce
This commit is contained in:
@@ -101,9 +101,6 @@ class Iperf():
|
||||
self.iperf_out = '/home/ubuntu/iperf_output.' + \
|
||||
hookenv.application_name() + '.txt'
|
||||
|
||||
def install_iperf(self):
|
||||
apt_install("iperf")
|
||||
|
||||
def listen(self, cidr=None, port=None):
|
||||
port = port or self.IPERF_BASE_PORT
|
||||
if cidr:
|
||||
@@ -144,7 +141,7 @@ class Iperf():
|
||||
|
||||
def get_increment(self, total_runtime, progression):
|
||||
return datetime.timedelta(
|
||||
minutes=math.ceil(total_runtime / len(progression)))
|
||||
seconds=math.ceil(total_runtime / len(progression)))
|
||||
|
||||
def get_plan(self, progression, increment):
|
||||
now = datetime.datetime.now()
|
||||
@@ -244,7 +241,7 @@ class Iperf():
|
||||
increment = self.get_increment(total_runtime, progression)
|
||||
plan = self.get_plan(progression, increment)
|
||||
finish_time = datetime.datetime.now() + datetime.timedelta(
|
||||
minutes=total_runtime)
|
||||
seconds=total_runtime)
|
||||
|
||||
self.wipe_batch_ctrl_file()
|
||||
action_output = []
|
||||
|
||||
Reference in New Issue
Block a user