|
Lines 31-36
Link Here
|
| 31 |
# /usr/share/common-licenses/AGPL-3; if not, see |
31 |
# /usr/share/common-licenses/AGPL-3; if not, see |
| 32 |
# <https://www.gnu.org/licenses/>. |
32 |
# <https://www.gnu.org/licenses/>. |
| 33 |
|
33 |
|
|
|
34 |
import chardet |
| 35 |
import codecs |
| 34 |
import os |
36 |
import os |
| 35 |
import re |
37 |
import re |
| 36 |
import sys |
38 |
import sys |
|
Lines 1917-1925
def check_gpo_presence():
Link Here
|
| 1917 |
gpcversion = obj["versionNumber"][0] |
1919 |
gpcversion = obj["versionNumber"][0] |
| 1918 |
config = ConfigParser.ConfigParser() |
1920 |
config = ConfigParser.ConfigParser() |
| 1919 |
try: |
1921 |
try: |
| 1920 |
with open(os.path.join(gpo_path, 'GPT.INI')) as f: |
1922 |
gpo_filepath = os.path.join(gpo_path, 'GPT.INI') |
|
|
1923 |
with open(gpo_filepath) as f: |
| 1924 |
encoding = chardet.detect(f.read())['encoding'] |
| 1925 |
with codecs.open(gpo_filepath, 'rb', encoding) as f: |
| 1921 |
try: |
1926 |
try: |
| 1922 |
config.readfp(f) |
1927 |
config.read_file(f) |
| 1923 |
fileversion = config.get('General', 'version') |
1928 |
fileversion = config.get('General', 'version') |
| 1924 |
if fileversion < gpcversion: |
1929 |
if fileversion < gpcversion: |
| 1925 |
log.error("File version %s of GPO %s is lower than GPO container versionNumber (%s)" % (fileversion, name, gpcversion)) |
1930 |
log.error("File version %s of GPO %s is lower than GPO container versionNumber (%s)" % (fileversion, name, gpcversion)) |