コード例 #1
0
ファイル: config.py プロジェクト: victorsamun/dg
 def get_commands(self, host):
     mountpoint = '/mnt'
     prefix = '/cygwin64/etc'
     args = ['-H', win.get_hostname(host),
             '-j', 'runc.urgu.org', '-p', '/etc/smb.pwd']
     if 'userqwer' in host.props['services']:
         args += ['-a', 'user:qwer', '-A', 'user:qwer']
     sysprep_xml = '{}/Windows/Panther/unattend.xml'.format(mountpoint)
     if self.win_data_label is not None:
         args += ['-c', r'"{} {} {}:\\"'.format(
             r'C:\\Windows\\Setup\\Scripts\\set-mountpoint.exe',
             self.win_data_label, self.win_data_letter)]
         home = r'{}:\\Users'.format(self.win_data_letter)
         args += ['-c', r'"cmd /c mkdir {}"'.format(home)]
         args += ['-P', home]
     cmds = [
         ['mount', self.get_win7_partition(), mountpoint],
         ['cp /etc/ssh/ssh_host_*_key{{,.pub}} {}{}'.format(
             mountpoint, prefix)],
         ['python', '/tmp/customize.py'] + args + [sysprep_xml, sysprep_xml],
     ]
     if self.win_data_label is not None:
         cmds.append([
             'sed', '-i',
             '"s/rem set profiles=/set profiles=' +
             r'{}:\\\\Users\\\\profiles.reg/"'.format(self.win_data_letter),
             '{}/Windows/Setup/Scripts/SetupComplete.cmd'.format(mountpoint)
         ])
     cmds.append(['umount', mountpoint])
     return cmds
コード例 #2
0
 def get_commands(self, host):
     mountpoint = '/mnt'
     prefix = '/cygwin64/etc'
     args = [
         '-H',
         win.get_hostname(host), '-j', 'runc.urgu.org', '-p', '/etc/smb.pwd'
     ]
     if 'userqwer' in host.props['services']:
         args += ['-a', 'user:qwer', '-A', 'user:qwer']
     sysprep_xml = '{}/Windows/Panther/unattend.xml'.format(mountpoint)
     if self.win_data_label is not None:
         args += [
             '-c', r'"{} {} {}:\\"'.format(
                 r'C:\\Windows\\Setup\\Scripts\\set-mountpoint.exe',
                 self.win_data_label, self.win_data_letter)
         ]
         home = r'{}:\\Users'.format(self.win_data_letter)
         args += ['-c', r'"cmd /c mkdir {}"'.format(home)]
         args += ['-P', home]
     cmds = [
         ['mount', self.get_win7_partition(), mountpoint],
         [
             'cp /etc/ssh/ssh_host_*_key{{,.pub}} {}{}'.format(
                 mountpoint, prefix)
         ],
         ['python', '/tmp/customize.py'] + args +
         [sysprep_xml, sysprep_xml],
     ]
     if self.win_data_label is not None:
         cmds.append([
             'sed', '-i', '"s/rem set profiles=/set profiles=' +
             r'{}:\\\\Users\\\\profiles.reg/"'.format(self.win_data_letter),
             '{}/Windows/Setup/Scripts/SetupComplete.cmd'.format(mountpoint)
         ])
     cmds.append(['umount', mountpoint])
     return cmds