-
Notifications
You must be signed in to change notification settings - Fork 273
Expand file tree
/
Copy pathAzureLinuxPatching.py
More file actions
executable file
·49 lines (44 loc) · 1.87 KB
/
Copy pathAzureLinuxPatching.py
File metadata and controls
executable file
·49 lines (44 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/python
#
# Copyright 2015 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import subprocess
from patch.AbstractPatching import AbstractPatching
from common import *
class AzureLinuxPatching(AbstractPatching):
def __init__(self,logger,distro_info):
super(AzureLinuxPatching,self).__init__(distro_info)
self.logger = logger
self.base64_path = '/usr/bin/base64'
self.bash_path = '/usr/bin/bash'
self.blkid_path = '/usr/bin/blkid'
self.cat_path = '/usr/bin/cat'
self.cryptsetup_path = '/usr/bin/cryptsetup'
self.dd_path = '/usr/bin/dd'
self.e2fsck_path = '/usr/bin/e2fsck'
self.echo_path = '/usr/bin/echo'
self.getenforce_path = '/usr/bin/getenforce'
self.setenforce_path = '/usr/bin/setenforce'
self.lsblk_path = '/usr/bin/lsblk'
self.usr_flag = 1
self.lsscsi_path = '/usr/bin/lsscsi'
self.mkdir_path = '/usr/bin/mkdir'
self.mount_path = '/usr/bin/mount'
self.openssl_path = '/usr/bin/openssl'
self.resize2fs_path = '/usr/bin/resize2fs'
self.umount_path = '/usr/bin/umount'
def install_extras(self):
common_extras = ['cryptsetup','lsscsi']
for extra in common_extras:
self.logger.log("installation for " + extra + ' result is ' + str(subprocess.call(['dnf', 'install','-y', extra])))