#84 'JSONPlugin' object has no attribute 'name'
Closed: Fixed None Opened 11 years ago by mizdebsk.

Version: Git branch release-0.2.1

When I try to exclude some checks I get the following exception:
{{{
AttributeError: 'JSONPlugin' object has no attribute 'name'
}}}
The failing command was {{{./try-fedora-review -v -b 836404 -x RCheckDir}}}. The same command without the test excluded ({{{./try-fedora-review -v -b 836404}}}) works fine.

I suspect this may be related to the following wierd output (note the first line):
{{{
$ ./try-fedora-review -d | head -3
<FedoraReview.jsonapi.JSONPlugin object at 0x222bf90>
CheckAddMavenDepmap -- Pom files have correct add_maven_depmap call
CheckBundledJars -- If source tarball includes bundled jar/class
}}}

Full output:
{{{
$ ./try-fedora-review -v -b 836404 -x RCheckDir
Processing bugzilla bug: 836404
Bugzilla v0.6.2 initializing
Choosing subclass for https://bugzilla.redhat.com/xmlrpc.cgi
Checking for RH Bugzilla method bugzilla.getProdInfo()
rhbz=True
Checking return value of Buzilla.version()
bzversion='4.2.2-3.3'
Chose subclass RHBugzilla v0.3
Trying bugzilla cookies for authentication
getbug(836404)
request_url is https://bugzilla.redhat.com/xmlrpc.cgi
send_cookies(): cookiejar empty. Nothing to send.
cookiejar now contains: {}
Bug(['external_choices', 'status_whiteboard', 'reporter_accessible', 'clone_of', 'cf_story_points', 'cc', 'rep_platform', 'cf_regression_status', 'creation_time', 'lastdiffed', 'reporter_id', 'flag_types', 'cf_mount_type', 'keywords', 'target_release', 'external_bugs', 'id', 'cf_extra_component', 'blocked', 'cf_type', 'cclist_accessible', 'cf_extra_version', 'bug_status', 'short_desc', 'priority', 'bug_file_loc', 'version', 'fixed_in', 'release_notes', 'cf_environment', 'product', 'cf_verified_branch', 'qa_contact', 'reporter', 'component', 'bug_severity', 'bug_id', 'groups', 'dependson', 'creation_ts', 'cf_documentation_action', 'target_milestone', 'everconfirmed', 'product_id', 'longdescs', 'delta_ts', 'summary', 'cf_crm', 'op_sys', 'attachments', 'alias', 'assigned_to', 'resolution', 'last_change_time'])
Getting .spec and .srpm Urls from : 836404
Active settings after processing options
resultdir: None
verbose: True
no_report: False
list_checks: False
single: None
rpm_spec: False
exclude: RCheckDir
ext_dirs: /home/kojan/.config/fedora-review/plugins:/usr/share/fedora-review/plugins:%s
log_level: 10
init_done: True
cache: False
mock_config: None
version: False
_log_config_done: True
bz_url: https://bugzilla.redhat.com
mock_options: --no-cleanup-after
other_bz: None
user: None
bug: 836404
prebuilt: False
name: None
url: None
nobuild: False
_con_handler: <logging.StreamHandler object at 0x114cfd0>
login: False
assign: False
--> SRPM url: http://galileo.fedorapeople.org/jboss-reflect/2.0.2-2/jboss-reflect-2.0.2-2.fc17.src.rpm
--> Spec url: http://galileo.fedorapeople.org/jboss-reflect/2.0.2-2/jboss-reflect.spec
Using review directory: /home/kojan/FedoraReview/836404-jboss-reflect
Downloading .spec and .srpm files
No upstream for (Source0): jboss-reflect-2.0.2.tar.xz
Add module: CheckAddMavenDepmap
Add module: CheckBundledJars
Add module: CheckJPackageRequires
Add module: CheckJavaFullVerReqSub
Add module: CheckJavadoc
Add module: CheckJavadocJPackageRequires
Add module: CheckJavadocdirName
Add module: CheckLocalDepmap
Add module: CheckNoArch
Add module: CheckNoOldMavenDepmap
Add module: CheckNoRequiresPost
Add module: CheckNotJavaApplicable
Add module: CheckPomInstalled
Add module: CheckTestSkip
Add module: CheckUpdateDepmap
Add module: CheckUpstremBuildMethod
Add module: CheckUseMavenpomdirMacro
Add module: GemCheckDoesntHaveNonGemSubpackage
Add module: GemCheckExcludesGemCache
Add module: GemCheckFilePlacement
Add module: GemCheckProperName
Add module: GemCheckRequiresProperDevel
Add module: GemCheckSetsGemName
Add module: GemCheckUsesMacros
Add module: NonGemCheckFilePlacement
Add module: NonGemCheckRequiresProperDevel
Add module: NonGemCheckUsesMacros
Add module: RubyCheckBuildArchitecture
Add module: RubyCheckPlatformSpecificFilePlacement
Add module: RubyCheckRequiresRubyAbi
Add module: RubyCheckTestsNotRunByRake
Add module: RubyCheckTestsRun
Add module: PhpCheckPhpRequire
Add module: RCheckBuildRequires
Add module: RCheckBuildSection
Add module: RCheckCheckMacro
Add module: RCheckDir
Add module: RCheckDoc
Add module: RCheckLatestVersionIsPackaged
Add module: RCheckRequires
Add module: CheckApprovedLicense
Add module: CheckBuild
Add module: CheckBuildCompilerFlags
Add module: CheckBuildInMock
Add module: CheckBuildRequires
Add module: CheckBuildroot
Add module: CheckBundledLibs
Add module: CheckChangelogFormat
Add module: CheckClean
Add module: CheckCodeAndContent
Add module: CheckConfigNoReplace
Add module: CheckContainsLicenseText
Add module: CheckDefattr
Add module: CheckDescMacroes
Add module: CheckDesktopFile
Add module: CheckDesktopFileInstall
Add module: CheckDevelFilesInDevel
Add module: CheckDirectoryRequire
Add module: CheckDistTag
Add module: CheckDocRuntime
Add module: CheckExcludeArch
Add module: CheckFilePermissions
Add module: CheckFileRequires
Add module: CheckFilesDuplicates
Add module: CheckFinalRequiresProvides
Add module: CheckFullVerReqSub
Add module: CheckFunctionAsDescribed
Add module: CheckGuidelines
Add module: CheckIllegalSpecTags
Add module: CheckInstall
Add module: CheckLargeDocs
Add module: CheckLatestVersionIsPackaged
Add module: CheckLicensInDoc
Add module: CheckLicenseField
Add module: CheckLicenseInSubpackages
Add module: CheckLicenseUpstream
Add module: CheckLocale
Add module: CheckMacros
Add module: CheckMakeinstall
Add module: CheckManPages
Add module: CheckNameCharset
Add module: CheckNaming
Add module: CheckNoConfigInUsr
Add module: CheckNoConflicts
Add module: CheckObeysFHS
Add module: CheckOwnDirs
Add module: CheckOwnOther
Add module: CheckPackageInstalls
Add module: CheckParallelMake
Add module: CheckPatchComments
Add module: CheckPkgConfigFiles
Add module: CheckRelocatable
Add module: CheckReqPkgConfig
Add module: CheckRequires
Add module: CheckRpmLint
Add module: CheckRpmLintInstalled
Add module: CheckScriptletSanity
Add module: CheckSourceComment
Add module: CheckSourceMD5
Add module: CheckSourcePatchPrefix
Add module: CheckSourceUrl
Add module: CheckSpecAsInSRPM
Add module: CheckSpecDescTranlation
Add module: CheckSpecLegibility
Add module: CheckSpecName
Add module: CheckSupportAllArchs
Add module: CheckSystemdScripts
Add module: CheckTestSuites
Add module: CheckTimeStamps
Add module: CheckUTF8Filenames
Add module: CheckUseGlobal
Add module: CheckUsefulDebuginfo
Add module: CheckHeaderFiles
Add module: CheckLDConfig
Add module: CheckLibToolArchives
Add module: CheckNoKernelModules
Add module: CheckNoStatucExecutables
Add module: CheckRPATH
Add module: CheckSoFiles
Add module: CheckStaticLibs
Add external module: /home/kojan/.config/fedora-review/plugins/mpl.pl
Running checks and generate report

Exception down the road...
Traceback (most recent call last):
File "/home/kojan/FedoraReview/src/FedoraReview/review_helper.py", line 133, in run
self.__do_report()
File "/home/kojan/FedoraReview/src/FedoraReview/review_helper.py", line 79, in __do_report
self.__run_checks(self.bug.spec_file, self.bug.srpm_file)
File "/home/kojan/FedoraReview/src/FedoraReview/review_helper.py", line 105, in __run_checks
writedown=not Settings.no_report)
File "/home/kojan/FedoraReview/src/FedoraReview/checks_class.py", line 159, in run_checks
self.exclude_checks(Settings.exclude)
File "/home/kojan/FedoraReview/src/FedoraReview/checks_class.py", line 122, in exclude_checks
found = filter(lambda i: i.name == c, self.ext_checks)
File "/home/kojan/FedoraReview/src/FedoraReview/checks_class.py", line 122, in <lambda>
found = filter(lambda i: i.name == c, self.ext_checks)
AttributeError: 'JSONPlugin' object has no attribute 'name'
Exception down the road...
}}}


'name' is a property defined in check_base. Might it be that Json calls not inherits check_base and fails for this reason?

Indeed. The 'name' property in python is basically the class name. The seemingly best candidate for a unique name for the plugin is the plugin path. This means that things like disabling, enabling and listing external tests will use the path to the plugin. Seems feasible.

Pushed a new branch json-fixes with remedies for #84, #85 and #86. Preferably needs a unit test (#87) before merging.

Login to comment on this ticket.

Metadata