Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id AC376E00C4A; Fri, 18 Dec 2015 01:24:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [134.134.136.24 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 46C25E007B4 for ; Fri, 18 Dec 2015 01:24:11 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 18 Dec 2015 01:24:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,445,1444719600"; d="scan'208";a="620057294" Received: from agusev-mobl2.ger.corp.intel.com (HELO lp.ger.corp.intel.com) ([10.252.27.121]) by FMSMGA003.fm.intel.com with ESMTP; 18 Dec 2015 01:24:10 -0800 From: Elliot Smith To: toaster@yoctoproject.org Date: Fri, 18 Dec 2015 09:23:44 +0000 Message-Id: <1450430639-14995-3-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1450430639-14995-1-git-send-email-elliot.smith@intel.com> References: <1450430639-14995-1-git-send-email-elliot.smith@intel.com> Subject: [review-request][PATCH 02/17] toaster: Move image file suffix list to model X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 09:24:18 -0000 Image file suffixes are used in the project configuration page to show a list of available image file types. This list is stored as a function in the views code. However, this list is also needed when parsing image file paths, so that the suffixes can be shown in the "all builds" and "project builds" tables. Move the list of valid image file suffixes to the Target_Image_File class to make is accessible in other places where it may be needed. [YOCTO #8738] Signed-off-by: Elliot Smith --- bitbake/lib/toaster/orm/models.py | 9 +++++++++ bitbake/lib/toaster/toastergui/views.py | 7 +------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 6e87c54..8d5f326 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -461,6 +461,15 @@ class Target(models.Model): return self.target class Target_Image_File(models.Model): + # valid suffixes for image files produced by a build + SUFFIXES = { + 'btrfs', 'cpio', 'cpio.gz', 'cpio.lz4', 'cpio.lzma', 'cpio.xz', + 'cramfs', 'elf', 'ext2', 'ext2.bz2', 'ext2.gz', 'ext2.lzma', 'ext4', + 'ext4.gz', 'ext3', 'ext3.gz', 'hddimg', 'iso', 'jffs2', 'jffs2.sum', + 'squashfs', 'squashfs-lzo', 'squashfs-xz', 'tar.bz2', 'tar.lz4', + 'tar.xz', 'tartar.gz', 'ubi', 'ubifs', 'vmdk' + } + target = models.ForeignKey(Target) file_name = models.FilePathField(max_length=254) file_size = models.IntegerField() diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index bd334b9..4cd7afd 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -2808,12 +2808,7 @@ if True: 'all_proxy','ftp_proxy','http_proxy ','https_proxy' } - vars_fstypes = { - 'btrfs','cpio','cpio.gz','cpio.lz4','cpio.lzma','cpio.xz','cramfs', - 'elf','ext2','ext2.bz2','ext2.gz','ext2.lzma', 'ext4', 'ext4.gz', 'ext3','ext3.gz','hddimg', - 'iso','jffs2','jffs2.sum','squashfs','squashfs-lzo','squashfs-xz','tar.bz2', - 'tar.lz4','tar.xz','tartar.gz','ubi','ubifs','vmdk' - } + vars_fstypes = Target_Image_File.SUFFIXES return(vars_managed,sorted(vars_fstypes),vars_blacklist) -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.