1
0
mirror of https://github.com/ubuntu/microk8s.git synced 2021-05-23 02:23:41 +03:00

In lxc detect boot from /proc/1 stats (#2270)

* In lxc detect boot from /proc/1 stats

* Fix style checks
This commit is contained in:
Konstantinos Tsakalozos
2021-05-18 09:11:55 +03:00
committed by GitHub
parent 506c16cb3e
commit b6acffb66f
5 changed files with 6 additions and 6 deletions

View File

@@ -674,6 +674,7 @@ is_first_boot() {
# The last-start-date file contains a date in seconds
# if that date is prior to the creation date of /proc/1 we assume this is the first
# time after the host booted
# Note, lxc shares the same /proc/stat as the host
if ! [ -e "$1/last-start-date" ] ||
! [ -e /proc/1 ]
then
@@ -681,7 +682,8 @@ is_first_boot() {
else
last_start=$("$SNAP/bin/cat" "$1/last-start-date")
if [ -e /proc/stat ] &&
grep btime /proc/stat
grep btime /proc/stat &&
! grep lxc /proc/1/environ
then
boot_time=$(grep btime /proc/stat | cut -d' ' -f2)
else

View File

@@ -9,7 +9,6 @@ import string
import subprocess
import sys
import time
from typing import List
import yaml

View File

@@ -429,6 +429,6 @@ class TestAddons(object):
validate_openebs()
print("Disabling OpenEBS")
microk8s_disable("openebs:force")
except CalledProcessError as err:
except CalledProcessError:
print("Nothing to do, since iscsid is not available")
return

View File

@@ -1,6 +1,5 @@
import time
import os
import shutil
import re
import requests
import platform

View File

@@ -9,7 +9,7 @@ envdir = {toxinidir}/.tox_env
passenv =
MK8S_*
deps =
black
black ==21.4b2
flake8
flake8-colors
pep8-naming
@@ -19,7 +19,7 @@ deps =
[testenv:lint]
commands =
-flake8
codespell --ignore-words-list="aks" --quiet-level=2 --skip="*.patch,*.spec,.tox_env"
codespell --ignore-words-list="aks" --quiet-level=2 --skip="*.patch,*.spec,.tox_env,.git"
black --diff --check --exclude "/(\.eggs|\.git|\.tox|\.venv|\.build|dist|charmhelpers|mod)/" .
[testenv:func]