change to python3 instead of explicit 3.6

This commit is contained in:
brent s
2018-08-07 10:54:59 -04:00
parent e1cd54a7b2
commit 8c9a3cd14b
21 changed files with 1007 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python3.6
#!/usr/bin/env python3
# requires python lxml module as well
import os

View File

@@ -99,8 +99,10 @@ bwlimit = 0
# will be created if necessary (assuming we have proper permissions).
lockfile = /var/run/repo-sync_{name}.lck
# The logfile for this repository. The parent directories will be created if
# necessary (assuming we have proper permissions).
# The logfile. This setting is actually for all repositories; changing it below
# will have no effect as all entries use the same log file. The parent
# directories will be created if necessary (assuming we have proper
# permissions).
logfile = /var/log/repo/centos.log
# The releases to clone for. Note that we follow symlinks, so you should *NOT*

View File

@@ -3,6 +3,7 @@
import configparser
import copy
import datetime
import importlib
import os
import platform
import re
@@ -16,6 +17,20 @@ cfgfile = os.path.join(os.environ['HOME'],
'repoclone',
'centos.ini')
# Set up the logger.
_selfpath = os.path.abspath(os.path.expanduser(__file__))
_logmodpath = os.path.join(_selfpath,
'..', '..', '..',
'lib',
'python',
'logger.py')
logger = importlib.util.module_from_spec(
importlib.util.spec_from_file_location(
'logger',
_logmodpath))
_loglevel = 'warning'
#_loglevel = 'debug'
class cur_ver(object):
def __init__(self):
_distname = platform.linux_distribution()[0]
@@ -90,6 +105,10 @@ class MirrorMgr(object):
self.get_cfg()
self.chk_cur_ver()
self.parse_cfg()
self.log = logger.log(os.path.abspath(os.path.expanduser(
logfile = self.cfg['DEFAULT'])),
logname = 'optools.repoclone.centos',
loglvl = _loglevel)
def get_cfg(self):
with open(cfgfile, 'r') as f:

9
centos/repoclone/test.py Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env python3
import os
selfpath = os.path.abspath(os.path.expanduser(__file__))
print(selfpath)
logmodpath = os.path.abspath(os.path.join(selfpath, '..', '..', '..', 'lib', 'python'))
print(logmodpath)