[meta-spdxscanner,V2] Remove redundant code.

Submitted by Li, Xiaoming on April 2, 2020, 4:45 p.m. | Patch ID: 171537

Details

Message ID 20200402164545.111457-1-lixm.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

Li, Xiaoming April 2, 2020, 4:45 p.m.
FOLDER_ID has already been assigned a defalut value "1", so there is no
need add 'or "1"' here.

Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
---
 classes/fossology-rest.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/classes/fossology-rest.bbclass b/classes/fossology-rest.bbclass
index 5c5ef70..69f4998 100644
--- a/classes/fossology-rest.bbclass
+++ b/classes/fossology-rest.bbclass
@@ -230,7 +230,7 @@  def get_folder_id(d):
         folder_name = d.getVar('FOLDER_NAME')
         folder_id = create_folder(d, folder_name)
     else:
-        folder_id = (d.getVar('FOLDER_ID', True) or "1")
+        folder_id = d.getVar('FOLDER_ID', False)
 
     bb.note("Folder Id =  " + str(folder_id))
     return str(folder_id)

Comments

Joshua Watt April 2, 2020, 4:10 p.m.
On 4/2/20 11:45 AM, Li, Xiaoming wrote:
> FOLDER_ID has already been assigned a defalut value "1", so there is no
> need add 'or "1"' here.
>
> Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
> ---
>   classes/fossology-rest.bbclass | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/classes/fossology-rest.bbclass b/classes/fossology-rest.bbclass
> index 5c5ef70..69f4998 100644
> --- a/classes/fossology-rest.bbclass
> +++ b/classes/fossology-rest.bbclass
> @@ -230,7 +230,7 @@ def get_folder_id(d):
>           folder_name = d.getVar('FOLDER_NAME')
>           folder_id = create_folder(d, folder_name)
>       else:
> -        folder_id = (d.getVar('FOLDER_ID', True) or "1")
> +        folder_id = d.getVar('FOLDER_ID', False)

You probably shouldn't be disabling variable expansion here (i.e. 
passing False as the second argument)?

>   
>       bb.note("Folder Id =  " + str(folder_id))
>       return str(folder_id)
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49037): https://lists.yoctoproject.org/g/yocto/message/49037
Mute This Topic: https://lists.yoctoproject.org/mt/72720682/3617530
Group Owner: yocto+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-