Skip to content

Commit e5e80ae

Browse files
committed
prevent systemwide py3 change and address linter issues
1 parent a098060 commit e5e80ae

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python3
22
# Licensed to the Apache Software Foundation (ASF) under one
33
# or more contributor license agreements. See the NOTICE file
44
# distributed with this work for additional information
@@ -301,4 +301,3 @@ if __name__ == "__main__":
301301
XenAPIPlugin.dispatch({"getVhdParent":getVhdParent, "mountNfsSecondaryStorage":mountNfsSecondaryStorage,
302302
"umountNfsSecondaryStorage":umountNfsSecondaryStorage,
303303
"makeDirectory":makeDirectory})
304-

scripts/vm/hypervisor/xenserver/xenserver84/cloudstack_pluginlib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
# Licensed to the Apache Software Foundation (ASF) under one
23
# or more contributor license agreements. See the NOTICE file
34
# distributed with this work for additional information

scripts/vm/hypervisor/xenserver/xenserver84/ovs-vif-flows.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
# Licensed to the Apache Software Foundation (ASF) under one
23
# or more contributor license agreements. See the NOTICE file
34
# distributed with this work for additional information

scripts/vm/hypervisor/xenserver/xenserver84/swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python -u
1+
#!/usr/bin/env python3
22
# Copyright (c) 2010-2011 OpenStack, LLC.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");

scripts/vm/hypervisor/xenserver/xenserver84/vmops

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python3
22
# Licensed to the Apache Software Foundation (ASF) under one
33
# or more contributor license agreements. See the NOTICE file
44
# distributed with this work for additional information
@@ -1180,7 +1180,7 @@ def cleanup_rules(session, args):
11801180

11811181
chainscmd = "iptables-save | grep '^:' | awk '{print $1}' | cut -d':' -f2 | sed 's/-def//'| sed 's/-eg//' | sort|uniq"
11821182
chains = util.pread2(['/bin/bash', '-c', chainscmd]).split('\n')
1183-
vmchains = [ch for ch in chains if 1 in [ ch.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-']]]
1183+
vmchains = [ch for ch in chains if 1 in [ ch.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-']]]
11841184
util.SMlog('cleanup_rules: vmchains= %s' %vmchains)
11851185
util.SMlog('cleanup_rules: found %s iptables chains for vms on this host %s' % (len(vmchains), hostname[0]))
11861186
cleaned = 0
@@ -1192,14 +1192,14 @@ def cleanup_rules(session, args):
11921192
#after trimming the vm names which more than 29 chars, resident vm name and iptables chain name is substring of
11931193
#of resident vm.
11941194
for rvm in resident_vms:
1195-
if vmname in rvm:
1195+
if vmname in rvm:
11961196
vmpresent = True
11971197
break
11981198

11991199
if vmpresent is False:
12001200
vmname = chain + "-untagged"
12011201
for rvm in resident_vms:
1202-
if vmname in rvm:
1202+
if vmname in rvm:
12031203
vmpresent = True
12041204
break
12051205
#vm chain is present but vm is not running on the host. So remove the rules

0 commit comments

Comments
 (0)