Merge "Stop use of oslo_utils.timeutils.strtime()"
This commit is contained in:
commit
e95bc6f5be
|
@ -13,11 +13,11 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging
|
import oslo_messaging
|
||||||
from oslo_utils import timeutils
|
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
|
|
||||||
from neutron.common import constants
|
from neutron.common import constants
|
||||||
|
@ -80,7 +80,7 @@ class PluginReportStateAPI(object):
|
||||||
agent_state['uuid'] = uuidutils.generate_uuid()
|
agent_state['uuid'] = uuidutils.generate_uuid()
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'agent_state': {'agent_state': agent_state},
|
'agent_state': {'agent_state': agent_state},
|
||||||
'time': timeutils.strtime(),
|
'time': datetime.utcnow().isoformat(),
|
||||||
}
|
}
|
||||||
method = cctxt.call if use_call else cctxt.cast
|
method = cctxt.call if use_call else cctxt.cast
|
||||||
return method(context, 'report_state', **kwargs)
|
return method(context, 'report_state', **kwargs)
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
from distutils import spawn
|
from distutils import spawn
|
||||||
import functools
|
import functools
|
||||||
import os
|
import os
|
||||||
|
@ -21,7 +22,6 @@ from neutronclient.common import exceptions as nc_exc
|
||||||
from neutronclient.v2_0 import client
|
from neutronclient.v2_0 import client
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import timeutils
|
|
||||||
|
|
||||||
from neutron.agent.linux import async_process
|
from neutron.agent.linux import async_process
|
||||||
from neutron.agent.linux import utils
|
from neutron.agent.linux import utils
|
||||||
|
@ -56,7 +56,7 @@ class ProcessFixture(fixtures.Fixture):
|
||||||
|
|
||||||
cmd = [spawn.find_executable(self.exec_name),
|
cmd = [spawn.find_executable(self.exec_name),
|
||||||
'--log-dir', log_dir,
|
'--log-dir', log_dir,
|
||||||
'--log-file', timeutils.strtime(fmt=fmt)]
|
'--log-file', datetime.utcnow().strftime(fmt)]
|
||||||
for filename in self.config_filenames:
|
for filename in self.config_filenames:
|
||||||
cmd += ['--config-file', filename]
|
cmd += ['--config-file', filename]
|
||||||
self.process = async_process.AsyncProcess(cmd)
|
self.process = async_process.AsyncProcess(cmd)
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from datetime import datetime
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import timeutils
|
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
|
@ -108,10 +108,10 @@ class AgentDBTestMixIn(object):
|
||||||
callback = agents_db.AgentExtRpcCallback()
|
callback = agents_db.AgentExtRpcCallback()
|
||||||
callback.report_state(self.adminContext,
|
callback.report_state(self.adminContext,
|
||||||
agent_state={'agent_state': lbaas_hosta},
|
agent_state={'agent_state': lbaas_hosta},
|
||||||
time=timeutils.strtime())
|
time=datetime.utcnow().isoformat())
|
||||||
callback.report_state(self.adminContext,
|
callback.report_state(self.adminContext,
|
||||||
agent_state={'agent_state': lbaas_hostb},
|
agent_state={'agent_state': lbaas_hostb},
|
||||||
time=timeutils.strtime())
|
time=datetime.utcnow().isoformat())
|
||||||
res += [lbaas_hosta, lbaas_hostb]
|
res += [lbaas_hosta, lbaas_hostb]
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
Loading…
Reference in New Issue