Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Rewrite chroot_setup in Python - #79

Open
markirish wants to merge 31 commits into
masterfrom
issue70-chroot_setup-python
Open

Rewrite chroot_setup in Python#79
markirish wants to merge 31 commits into
masterfrom
issue70-chroot_setup-python

Conversation

@markirish

Copy link
Copy Markdown

Initial rough attempt at converting chroot_setup.sh to chroot_setup.py
Currently has a bugs, may not run, but every function save one has been converted to rough Python

Signed-off-by: Mark Irish mirish@ibm.com

Initial rough attempt at converting chroot_setup.sh to chroot_setup.py
Currently has a bugs, may not run, but every function save one has been converted to rough Python

Signed-off-by: Mark Irish <mirish@ibm.com>
@markirish

Copy link
Copy Markdown
Author

Created draft pull request so @abmusse , @kadler , and myself have a place to discuss the code.

Code hasn't be intensively tested, I'm a bit of a coward with firing it off with all the os module calls inside of it. Pushed so that Abdirahim can see what I've done, discuss and help fix problems, and take over the effort himself if that's what he wants to do.

@markirish

Copy link
Copy Markdown
Author

One thing I didn't know: In the .sh file, do chroot_ln_fix_rel replace chroot_ln_rel? They appear to be doing similar things to my admittedly non-Bash eyes, so I only implemented the former.

Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated

@kadler kadler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preliminary comments. This seems like a straight-forward port from the original shell script. While that definitely has improvements over the shell script, I'd like to go even further.

Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated
# TODO: documentation
def initial_check ():
if (os.path.exists('/QOpenSys/usr/bin')):
CHROOT_DEBUG = False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By Python conventions this would be a constant, but it's being altered below. Instead, we can drop this variable and reference args.verbose instead.

In addition, @abmusse mentioned using args.verbose to adjust the logging level and then just calling the appropriate logging function and we never have to even check the variable anywhere else.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is separate from verbosity of logging as when this is set, no action will be performed but it will still go through showing what would be done. Many utilities have command line options for this, usually with --dry-run or -n. I think that would make more sense to do something like that.

@abmusse abmusse Dec 22, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me the CHROOT_DEBUG variable was a misnomer because it really was used to guard against running commands on non IBM i systems as it was only set to true in the else leg of initial_check when the script was run on non IBM i system then the script exited.

Therefore none of the actions would run anyway so why did the script even bother to include checks for CHROOT_DEBUG in the actions? See

CHROOT_DEBUG=1

Every chroot_* action checked if debug was == 0 (passed the is IBM i check) , To prevent running any action on non IBM i system.

See

if (($CHROOT_DEBUG==0)); then

@abmusse abmusse Jan 27, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can get rid of all the if not CHROOT_DEBUG in the chroot_* actions. We just need to exit the script properly in the initial_check if we are not running on IBM i.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed up in 1991e26

Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated
Comment thread chroot_setup.py Outdated
@markirish

Copy link
Copy Markdown
Author

Sorry, didn't see that @abmusse unassigned himself from #70. Will take a stab at this once I finish up some of the rpm issues I am working on (and stabilize some sequelize-ibmi and odbc issues).

Fix all build and runtime errors
Ensure that basic functionality works

Signed-off-by: Mark Irish <mirish@ibm.com>
@markirish

Copy link
Copy Markdown
Author

Ok I changed the name and apparently it didn't like that for keeping track of everything.

What I changed:

  • Made sure that all functions are passed a single string that represents the line from the file. Then each function has to call line.split() to split it into tokens, which it then parses.
  • Create assert statements in functions to make sure that the right number of tokens are passed for each action
  • Print out every Python command that will be run, instead of the terminal command. (These should probably be hidden behind the -v flag I would think, most people probably don't care about all of that output).
  • Rewrite some functions like chroot_mknod to make sure that it parses to get what the Python functions are expecting.

I have run this with DEBUG = True, so that it tells me what it will run but doesn't actually run it. I think I will try to run these functions/actions piecemeal, as I'm afraid of them doing something bad like mucking with the entire file structure. I suppose I could try to run it inside of a chroot (to create a sub chroot?), and that way I wouldn't have to be afraid...

Change all print statements to their Python functions
Add documentation
Implement chroot_ln_rel function
Fix bugs
Add help text
@markirish

Copy link
Copy Markdown
Author

Ok! This is finally to a stage where it is working and I feel confident that it can do what it needs to do. I built with a chroot_minimal.lst and it (mostly) worked. I say mostly because Python chokes on things that running the bash utilities doesn't. Thinks like trying to symlink things that already exist, or copying files/directories that don't exist. I've made some changes to that .lst to get it to a point where this program doesn't choke.

The only thing now is to clean it up, change wording on things like help text (or that goofy ASCII text art), and refactor where desired.

@markirish
markirish marked this pull request as ready for review December 16, 2020 03:19
@markirish
markirish requested review from abmusse and kadler December 16, 2020 03:19
Signed-off-by: Mark Irish <mirish@ibm.com>
Comment thread chroot_setup Outdated
Comment on lines +367 to +368
mylist.append(SCRIPT_DIR + "/chroot_includes.lst")
mylist.append(SCRIPT_DIR + "/chroot_minimal.lst")

@abmusse abmusse Dec 22, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After #75, we should now use default.lst instead.

Suggested change
mylist.append(SCRIPT_DIR + "/chroot_includes.lst")
mylist.append(SCRIPT_DIR + "/chroot_minimal.lst")
mylist.append(f'{SCRIPT_DIR}/default.lst')

@abmusse abmusse Jan 14, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch would need to be rebased with master to pull in config/default.lst

Comment thread chroot_setup Outdated
# Only chroot_directory was provided to the script:
# Ask if minimal with includes chroot is desired
if not auto_yes:
val = input("Would you like to create a minimal chroot w/ includes @ " + CHROOT_DIR + "? [y/N]:")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val = input("Would you like to create a minimal chroot w/ includes @ " + CHROOT_DIR + "? [y/N]:")
val = input("Would you like to create a default chroot environment @ " + CHROOT_DIR + "? [y/N]:")

@abmusse abmusse Jan 14, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will wait for this branch to get rebased with master for this change and #79 (comment)

Comment thread config/chroot_minimal.lst
/QOpenSys/usr/lib/libpthread.a /QOpenSys/usr/ccs/lib/libpthread.a
/QOpenSys/usr/lib/libpthreads.a /QOpenSys/usr/ccs/lib/libpthreads.a
/QOpenSys/usr/lib/libpthreads_compat.a /QOpenSys/usr/ccs/lib/libpthreads_compat.a
/QOpenSys/usr/lib/libpthreads_compat.a /QOpenSys/usr/ccs/lib/bpthreads_compat.a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

Comment thread config/chroot_minimal.lst
Comment on lines +614 to +620
# (system "CHGAUT OBJ('/QOpenSys/ranger/home/ranger') USER(RANGER) DTAAUTRWX) # OBJAUT(*ALL) SUBTREE(*ALL)")
# -- variable substitution example (mydir and myuser) --
# > ./chroot_setup.sh chroot_system.lst /QOpenSys/ranger mydir=/QOpenSys/ranger myuser=RANGER
# > ./chroot_setup.sh chroot_system.lst /QOpenSys/ranger mydir=/QOpenSys/nger # myuser=RANGER
#
:system
# CHGAUT OBJ('/QOpenSys/ranger/home/ranger') USER(RANGER) DTAAUT(*RWX) OBJAUT(*ALL) SUBTREE(*ALL)
# CHGAUT OBJ('mydir/home/myuser') USER(myuser) DTAAUT(*RWX) OBJAUT(*ALL) SUBTREE(*ALL)


# CHGAUT OBJ('/QOpenSys/ranger/home/ranger') USER(RANGER) DTAAUT(*RWX) JAUT# (*ALL) SUBTREE(*ALL)
# CHGAUT OBJ('mydir/home/myuser') USER(myuser) DTAAUT(*RWX) OBJAUT(*ALL) SUBTREE# (*ALL)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Find/replace gone wrong?

Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated

@kadler kadler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the specific comments, I'd also like to add that the code should be run through pylint - for sure the indentation should be adjusted to 4 spaces.

Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment on lines +385 to +391
# check that the .lst file exists
if not os.path.isfile(CHROOT_LIST):
print(f"{CHROOT_LIST} cannot be found in {os.cwd}")
sys.exit(-7)
else:
# append file name to end of list
mylist.append(os.readlink(CHROOT_LIST))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a TOCTOU race condition. Instead, call os.readlink unconditionally and handle the FileNotFoundException.

Suggested change
# check that the .lst file exists
if not os.path.isfile(CHROOT_LIST):
print(f"{CHROOT_LIST} cannot be found in {os.cwd}")
sys.exit(-7)
else:
# append file name to end of list
mylist.append(os.readlink(CHROOT_LIST))
try:
mylist.append(os.readlink(CHROOT_LIST))
except FileNotFoundException:
print(f"{CHROOT_LIST} cannot be found in {os.cwd}")
sys.exit(-7)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should open them too, while we're at it. If we still want to print the file path later, we could store a tuple(path, file obj) in the array.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed up in d80220a

Instead of checking if the file exists I just append the file name to the last. later in the chroot_setup function the file is opened for reading.

Comment thread chroot_setup Outdated
Comment on lines +409 to +415
for key in globals_dictionary:
os.environ[key] = globals_dictionary[key]

chroot_setup(chroot_file)

for key in globals_dictionary:
del os.environ[key]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we add and remove all the globals for each file?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I think we should stop using environment variables for this behavior and use a dictionary for the passed mappings instead. Of course, this does break any scripts that relied on environment variables which were set prior to invoking the script. If such list files exist, we could add a fallback to check the environ if it's not found in the mapping.

@abmusse abmusse Jan 28, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually these globals were never used as environment variables in the original script. These are named variables passed into chroot_setup.sh that get substitute placeholder values in the xxx.lst files. See https://github.com/IBM/ibmichroot#advanced.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed up in ffb07ef

Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment on lines +244 to +268
elif line.startswith(':'):
action = action_dictionary[line]

# Execute action
else:
if action is not None:
action(line)

# Mapping the .lst action keys to the functions that run on their values
action_dictionary = {
':file' : chroot_setup,
':mkdir' : chroot_mkdir, # done
':ln_fix_rel' : chroot_ln_fix_rel, # done
':ln_rel' : chroot_ln_rel, # done
':ln' : chroot_ln, # done
':mknod' : chroot_mknod, # done
':cp_dir' : chroot_cp_dir, # done
':cp' : chroot_cp, # done
':chmod_dir' : chroot_chmod_dir, # done
':chmod' : chroot_chmod, # done
':chown_dir' : chroot_chown_dir, # done
':chown' : chroot_chown, # done
':system' : chroot_system, # done
':sh' : chroot_sh # done
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wanted to enforce a consistent function naming scheme, this mapping could go away:

    elif line.startswith(':'):
        function = f"chroot_{line[1:]}"
        action = globals()[function]

In addition, it might be good to catch the KeyError if the user gives an unexpected action.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only inconsistent action -> function name is:

':file'       : chroot_setup,

We could make a wrapper chroot_file function that calls chroot_setup

@abmusse abmusse Feb 11, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed up in ca5966b

Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
Comment thread chroot_setup Outdated
@abmusse

abmusse commented Feb 11, 2021

Copy link
Copy Markdown
Member

@kadler I've fixed up the requested changes and added flake8 linter action derived from default pythonpackage.yml

After fixing up initial linter issues undefined names in 6022fb9, We now have a bunch of cleaning up todo:

chroot_setup:12:1: F401 'enum.Enum' imported but unused
chroot_setup:16:46: W291 trailing whitespace
chroot_setup:17:46: W291 trailing whitespace
chroot_setup:18:46: W291 trailing whitespace
chroot_setup:19:46: W291 trailing whitespace
chroot_setup:20:46: W291 trailing whitespace
chroot_setup:21:46: W291 trailing whitespace
chroot_setup:22:1: W293 blank line contains whitespace
chroot_setup:23:40: W291 trailing whitespace
chroot_setup:24:41: W291 trailing whitespace
chroot_setup:25:41: W291 trailing whitespace
chroot_setup:26:40: W291 trailing whitespace
chroot_setup:27:35: W291 trailing whitespace
chroot_setup:28:35: W291 trailing whitespace
chroot_setup:34:1: E302 expected 2 blank lines, found 1
chroot_setup:34:17: E211 whitespace before '('
chroot_setup:35:3: E111 indentation is not a multiple of four
chroot_setup:36:3: E111 indentation is not a multiple of four
chroot_setup:42:1: E302 expected 2 blank lines, found 1
chroot_setup:42:14: E211 whitespace before '('
chroot_setup:43:3: E111 indentation is not a multiple of four
chroot_setup:45:3: E111 indentation is not a multiple of four
chroot_setup:48:3: E111 indentation is not a multiple of four
chroot_setup:50:3: E111 indentation is not a multiple of four
chroot_setup:51:3: E111 indentation is not a multiple of four
chroot_setup:56:1: E302 expected 2 blank lines, found 1
chroot_setup:56:18: E211 whitespace before '('
chroot_setup:57:3: E111 indentation is not a multiple of four
chroot_setup:59:3: E111 indentation is not a multiple of four
chroot_setup:62:3: E111 indentation is not a multiple of four
chroot_setup:63:3: E111 indentation is not a multiple of four
chroot_setup:64:3: E111 indentation is not a multiple of four
chroot_setup:65:3: E111 indentation is not a multiple of four
chroot_setup:66:3: E111 indentation is not a multiple of four
chroot_setup:67:3: E111 indentation is not a multiple of four
chroot_setup:68:3: E111 indentation is not a multiple of four
chroot_setup:69:3: E111 indentation is not a multiple of four
chroot_setup:70:3: E111 indentation is not a multiple of four
chroot_setup:76:1: E302 expected 2 blank lines, found 1
chroot_setup:76:22: E211 whitespace before '('
chroot_setup:77:3: E111 indentation is not a multiple of four
chroot_setup:79:3: E111 indentation is not a multiple of four
chroot_setup:82:3: E111 indentation is not a multiple of four
chroot_setup:83:3: E111 indentation is not a multiple of four
chroot_setup:84:3: E111 indentation is not a multiple of four
chroot_setup:85:3: E111 indentation is not a multiple of four
chroot_setup:86:3: E111 indentation is not a multiple of four
chroot_setup:87:3: E111 indentation is not a multiple of four
chroot_setup:88:3: E111 indentation is not a multiple of four
chroot_setup:89:3: E111 indentation is not a multiple of four
chroot_setup:90:3: E111 indentation is not a multiple of four
chroot_setup:91:3: E111 indentation is not a multiple of four
chroot_setup:95:1: E302 expected 2 blank lines, found 1
chroot_setup:95:17: E211 whitespace before '('
chroot_setup:96:3: E114 indentation is not a multiple of four (comment)
chroot_setup:97:3: E114 indentation is not a multiple of four (comment)
chroot_setup:98:3: E111 indentation is not a multiple of four
chroot_setup:100:3: E111 indentation is not a multiple of four
chroot_setup:103:3: E111 indentation is not a multiple of four
chroot_setup:103:12: E221 multiple spaces before operator
chroot_setup:105:3: E114 indentation is not a multiple of four (comment)
chroot_setup:106:3: E111 indentation is not a multiple of four
chroot_setup:110:3: E111 indentation is not a multiple of four
chroot_setup:112:3: E114 indentation is not a multiple of four (comment)
chroot_setup:113:3: E111 indentation is not a multiple of four
chroot_setup:114:3: E111 indentation is not a multiple of four
chroot_setup:115:3: E111 indentation is not a multiple of four
chroot_setup:117:3: E111 indentation is not a multiple of four
chroot_setup:118:3: E111 indentation is not a multiple of four
chroot_setup:119:3: E111 indentation is not a multiple of four
chroot_setup:121:3: E111 indentation is not a multiple of four
chroot_setup:124:3: E111 indentation is not a multiple of four
chroot_setup:129:1: E302 expected 2 blank lines, found 1
chroot_setup:129:14: E211 whitespace before '('
chroot_setup:130:3: E111 indentation is not a multiple of four
chroot_setup:131:3: E111 indentation is not a multiple of four
chroot_setup:136:1: E302 expected 2 blank lines, found 1
chroot_setup:136:18: E211 whitespace before '('
chroot_setup:137:3: E111 indentation is not a multiple of four
chroot_setup:138:3: E114 indentation is not a multiple of four (comment)
chroot_setup:139:3: E114 indentation is not a multiple of four (comment)
chroot_setup:140:3: E114 indentation is not a multiple of four (comment)
chroot_setup:141:3: E114 indentation is not a multiple of four (comment)
chroot_setup:142:3: E111 indentation is not a multiple of four
chroot_setup:142:28: E231 missing whitespace after ','
chroot_setup:144:3: E111 indentation is not a multiple of four
chroot_setup:146:7: E111 indentation is not a multiple of four
chroot_setup:151:1: E302 expected 2 blank lines, found 1
chroot_setup:151:17: E211 whitespace before '('
chroot_setup:152:3: E111 indentation is not a multiple of four
chroot_setup:154:3: E111 indentation is not a multiple of four
chroot_setup:157:3: E111 indentation is not a multiple of four
chroot_setup:158:3: E111 indentation is not a multiple of four
chroot_setup:159:3: E111 indentation is not a multiple of four
chroot_setup:160:3: E111 indentation is not a multiple of four
chroot_setup:164:1: E302 expected 2 blank lines, found 1
chroot_setup:164:21: E211 whitespace before '('
chroot_setup:165:3: E111 indentation is not a multiple of four
chroot_setup:167:3: E111 indentation is not a multiple of four
chroot_setup:170:3: E111 indentation is not a multiple of four
chroot_setup:171:3: E111 indentation is not a multiple of four
chroot_setup:172:3: E111 indentation is not a multiple of four
chroot_setup:174:7: E111 indentation is not a multiple of four
chroot_setup:175:7: E111 indentation is not a multiple of four
chroot_setup:177:7: E111 indentation is not a multiple of four
chroot_setup:178:7: E111 indentation is not a multiple of four
chroot_setup:182:1: E302 expected 2 blank lines, found 1
chroot_setup:182:17: E211 whitespace before '('
chroot_setup:183:3: E111 indentation is not a multiple of four
chroot_setup:185:3: E111 indentation is not a multiple of four
chroot_setup:188:3: E111 indentation is not a multiple of four
chroot_setup:189:3: E111 indentation is not a multiple of four
chroot_setup:190:3: E111 indentation is not a multiple of four
chroot_setup:191:3: E111 indentation is not a multiple of four
chroot_setup:195:1: E302 expected 2 blank lines, found 1
chroot_setup:195:21: E211 whitespace before '('
chroot_setup:196:3: E111 indentation is not a multiple of four
chroot_setup:198:3: E111 indentation is not a multiple of four
chroot_setup:201:3: E111 indentation is not a multiple of four
chroot_setup:202:3: E111 indentation is not a multiple of four
chroot_setup:203:3: E111 indentation is not a multiple of four
chroot_setup:205:7: E111 indentation is not a multiple of four
chroot_setup:206:7: E111 indentation is not a multiple of four
chroot_setup:208:7: E111 indentation is not a multiple of four
chroot_setup:209:7: E111 indentation is not a multiple of four
chroot_setup:213:1: E302 expected 2 blank lines, found 1
chroot_setup:214:3: E111 indentation is not a multiple of four
chroot_setup:215:3: E111 indentation is not a multiple of four
chroot_setup:216:3: E111 indentation is not a multiple of four
chroot_setup:221:1: E302 expected 2 blank lines, found 1
chroot_setup:222:3: E111 indentation is not a multiple of four
chroot_setup:223:3: E111 indentation is not a multiple of four
chroot_setup:224:3: E111 indentation is not a multiple of four
chroot_setup:228:1: E302 expected 2 blank lines, found 1
chroot_setup:229:3: E111 indentation is not a multiple of four
chroot_setup:231:1: E302 expected 2 blank lines, found 1
chroot_setup:231:17: E211 whitespace before '('
chroot_setup:232:3: E111 indentation is not a multiple of four
chroot_setup:236:7: E111 indentation is not a multiple of four
chroot_setup:238:11: E114 indentation is not a multiple of four (comment)
chroot_setup:239:11: E111 indentation is not a multiple of four
chroot_setup:241:7: E111 indentation is not a multiple of four
chroot_setup:243:7: E114 indentation is not a multiple of four (comment)
chroot_setup:244:7: E111 indentation is not a multiple of four
chroot_setup:247:7: E114 indentation is not a multiple of four (comment)
chroot_setup:248:7: E111 indentation is not a multiple of four
chroot_setup:249:11: E114 indentation is not a multiple of four (comment)
chroot_setup:250:11: E114 indentation is not a multiple of four (comment)
chroot_setup:251:11: E114 indentation is not a multiple of four (comment)
chroot_setup:252:11: E114 indentation is not a multiple of four (comment)
chroot_setup:253:11: E114 indentation is not a multiple of four (comment)
chroot_setup:254:11: E111 indentation is not a multiple of four
chroot_setup:255:11: E111 indentation is not a multiple of four
chroot_setup:258:11: E111 indentation is not a multiple of four
chroot_setup:262:7: E114 indentation is not a multiple of four (comment)
chroot_setup:263:7: E111 indentation is not a multiple of four
chroot_setup:265:11: E111 indentation is not a multiple of four
chroot_setup:269:1: E302 expected 2 blank lines, found 1
chroot_setup:270:3: E111 indentation is not a multiple of four
chroot_setup:275:3: E111 indentation is not a multiple of four
chroot_setup:284:3: E111 indentation is not a multiple of four
chroot_setup:285:3: E111 indentation is not a multiple of four
chroot_setup:286:3: E111 indentation is not a multiple of four
chroot_setup:287:3: E111 indentation is not a multiple of four
chroot_setup:288:3: E111 indentation is not a multiple of four
chroot_setup:289:3: E111 indentation is not a multiple of four
chroot_setup:291:1: E302 expected 2 blank lines, found 1
chroot_setup:292:3: E111 indentation is not a multiple of four
chroot_setup:297:1: E305 expected 2 blank lines after class or function definition, found 1
chroot_setup:297:1: C901 'If 297' is too complex (19)
chroot_setup:298:3: E111 indentation is not a multiple of four
chroot_setup:299:3: E114 indentation is not a multiple of four (comment)
chroot_setup:300:3: E111 indentation is not a multiple of four
chroot_setup:301:3: E111 indentation is not a multiple of four
chroot_setup:301:128: E501 line too long (132 > 127 characters)
chroot_setup:302:3: E114 indentation is not a multiple of four (comment)
chroot_setup:303:3: E111 indentation is not a multiple of four
chroot_setup:303:128: E501 line too long (128 > 127 characters)
chroot_setup:304:3: E111 indentation is not a multiple of four
chroot_setup:304:128: E501 line too long (131 > 127 characters)
chroot_setup:305:3: E111 indentation is not a multiple of four
chroot_setup:306:3: E111 indentation is not a multiple of four
chroot_setup:307:3: E111 indentation is not a multiple of four
chroot_setup:308:3: E111 indentation is not a multiple of four
chroot_setup:310:3: E111 indentation is not a multiple of four
chroot_setup:311:3: E111 indentation is not a multiple of four
chroot_setup:312:3: E111 indentation is not a multiple of four
chroot_setup:314:3: E111 indentation is not a multiple of four
chroot_setup:316:3: E111 indentation is not a multiple of four
chroot_setup:317:3: E111 indentation is not a multiple of four
chroot_setup:319:3: E114 indentation is not a multiple of four (comment)
chroot_setup:320:3: E114 indentation is not a multiple of four (comment)
chroot_setup:321:3: E111 indentation is not a multiple of four
chroot_setup:322:3: E111 indentation is not a multiple of four
chroot_setup:324:3: E114 indentation is not a multiple of four (comment)
chroot_setup:325:3: E114 indentation is not a multiple of four (comment)
chroot_setup:326:3: E111 indentation is not a multiple of four
chroot_setup:329:3: E111 indentation is not a multiple of four
chroot_setup:330:3: E111 indentation is not a multiple of four
chroot_setup:331:3: E111 indentation is not a multiple of four
chroot_setup:333:3: E111 indentation is not a multiple of four
chroot_setup:338:3: E111 indentation is not a multiple of four
chroot_setup:340:3: E111 indentation is not a multiple of four
chroot_setup:344:3: E111 indentation is not a multiple of four
chroot_setup:346:7: E111 indentation is not a multiple of four
chroot_setup:352:7: E111 indentation is not a multiple of four
chroot_setup:353:7: E111 indentation is not a multiple of four
chroot_setup:356:3: E303 too many blank lines (2)
chroot_setup:356:3: E114 indentation is not a multiple of four (comment)
chroot_setup:357:3: E111 indentation is not a multiple of four
chroot_setup:359:3: E111 indentation is not a multiple of four
chroot_setup:364:7: E111 indentation is not a multiple of four
chroot_setup:368:7: E111 indentation is not a multiple of four
chroot_setup:369:7: E111 indentation is not a multiple of four
chroot_setup:370:7: E111 indentation is not a multiple of four
chroot_setup:375:3: E111 indentation is not a multiple of four
chroot_setup:378:7: E111 indentation is not a multiple of four
chroot_setup:380:7: E111 indentation is not a multiple of four
chroot_setup:382:7: E114 indentation is not a multiple of four (comment)
chroot_setup:383:7: E111 indentation is not a multiple of four
chroot_setup:386:7: E114 indentation is not a multiple of four (comment)
chroot_setup:387:7: E111 indentation is not a multiple of four
chroot_setup:390:7: E114 indentation is not a multiple of four (comment)
chroot_setup:391:7: E111 indentation is not a multiple of four
chroot_setup:393:3: E111 indentation is not a multiple of four
chroot_setup:394:3: E111 indentation is not a multiple of four
chroot_setup:396:3: E114 indentation is not a multiple of four (comment)
chroot_setup:397:3: E114 indentation is not a multiple of four (comment)
chroot_setup:398:3: E111 indentation is not a multiple of four
chroot_setup:399:3: E111 indentation is not a multiple of four
chroot_setup:400:7: E111 indentation is not a multiple of four
chroot_setup:404:3: E111 indentation is not a multiple of four
chroot_setup:410:3: E111 indentation is not a multiple of four
chroot_setup:411:3: E111 indentation is not a multiple of four
chroot_setup:412:3: E111 indentation is not a multiple of four
chroot_setup:414:7: E111 indentation is not a multiple of four
chroot_setup:415:7: E111 indentation is not a multiple of four
chroot_setup:416:7: E111 indentation is not a multiple of four
chroot_setup:417:7: E111 indentation is not a multiple of four
chroot_setup:418:7: E111 indentation is not a multiple of four
chroot_setup:419:3: E111 indentation is not a multiple of four
chroot_setup:422:3: E114 indentation is not a multiple of four (comment)
chroot_setup:423:3: E111 indentation is not a multiple of four
chroot_setup:426:3: E111 indentation is not a multiple of four
1     C901 'If 297' is too complex (19)
163   E111 indentation is not a multiple of four
30    E114 indentation is not a multiple of four (comment)
12    E211 whitespace before '('
1     E221 multiple spaces before operator
1     E231 missing whitespace after ','
17    E302 expected 2 blank lines, found 1
1     E303 too many blank lines (2)
1     E305 expected 2 blank lines after class or function definition, found 1
3     E501 line too long (132 > 127 characters)
1     F401 'enum.Enum' imported but unused
12    W291 trailing whitespace
1     W293 blank line contains whitespace
244

Note these linter issues are considered warnings.
the action looks for syntax errors or undefined names and considers those fatal.

...

      run: |
        # stop the build if there are Python syntax errors or undefined names
        flake8 chroot_setup --count --select=E9,F63,F7,F82 --show-source --statistics
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        flake8 chroot_setup --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants