コード例 #1
0
ファイル: disk_format_gce.py プロジェクト: k0da/kiwi-1
    def create_image_format(self):
        self.temp_image_dir = mkdtemp(
            dir=self.target_dir
        )
        diskname = ''.join(
            [
                self.target_dir, '/',
                self.xml_state.xml_data.get_name(), '.raw'
            ]
        )
        Command.run(
            ['cp', diskname, self.temp_image_dir + '/disk.raw']
        )
        if self.tag:
            with open(self.temp_image_dir + '/manifest.json', 'w') as manifest:
                manifest.write('{"licenses":["%s"]}' % self.tag)

        archive_name = self.get_target_name_for_format('gce')

        # delete the '.gz' suffix from the name. The suffix is appended by
        # the archive creation method depending on the creation type.
        archive_name = archive_name.replace('.gz', '')

        archive = ArchiveTar(
            self.target_dir + '/' + archive_name
        )
        archive.create_gnu_gzip_compressed(
            self.temp_image_dir
        )
コード例 #2
0
ファイル: disk_format_gce.py プロジェクト: k0da/kiwi-1
    def create_image_format(self):
        self.temp_image_dir = mkdtemp(dir=self.target_dir)
        diskname = ''.join(
            [self.target_dir, '/',
             self.xml_state.xml_data.get_name(), '.raw'])
        Command.run(['cp', diskname, self.temp_image_dir + '/disk.raw'])
        if self.tag:
            with open(self.temp_image_dir + '/manifest.json', 'w') as manifest:
                manifest.write('{"licenses":["%s"]}' % self.tag)

        archive_name = self.get_target_name_for_format('gce')

        # delete the '.gz' suffix from the name. The suffix is appended by
        # the archive creation method depending on the creation type.
        archive_name = archive_name.replace('.gz', '')

        archive = ArchiveTar(self.target_dir + '/' + archive_name)
        archive.create_gnu_gzip_compressed(self.temp_image_dir)