searchOCIProject method on distribution object (launchpadlib)

Asked by Tomáš Virtus

Hello,

I'd like to use launchpadlib to enumerate all OCI projects in ubuntu-docker-images given distribution on production Lunachpad. According to devel documentation at https://api.launchpad.net/devel.html#distribution-searchOCIProjects the distribution object should support searchOCIProject GET "method". However, with latest version of launchpadlib, when I check lp_operations of the distribution object, the operation is not there. The code I'm using is:

  import os.path
  from launchpadlib.launchpad import Launchpad
  from launchpadlib.credentials import UnencryptedFileCredentialStore

  cred_location = os.path.expanduser('~/.lp_creds')
  credential_store = UnencryptedFileCredentialStore(cred_location)
  lp = Launchpad.login_with(
      'enumerate-oci',
      'production',
      version='devel',
      credential_store=credential_store
  )
  distrib = lp.load('ubuntu-docker-images')
  for op in sorted(distrib.lp_operations):
      print(op)

The list of operations I get is:

addAnswerContact
addBugSubscription
addBugSubscriptionFilter
addOfficialBugTag
canUserAlterAnswerContact
findReferencedOOPS
findSimilarQuestions
getAnswerContactsForLanguage
getBranches
getMergeProposals
getMilestone
getQuestion
getRelease
getSeries
getSpecification
getSubscription
getSubscriptions
getSupportedLanguages
getTranslationImportQueueEntries
get_timeline
newCodeImport
newSeries
removeAnswerContact
removeBugSubscription
removeOfficialBugTag
searchQuestions
searchTasks
userHasBugSubscriptions

Is it possible to still call the searchOCIProject method without it being in lp_operations? If so, how?

TIA!

Question information

Language:
English Edit question
Status:
Answered
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :
#1

ubuntu-docker-image is a `project`, not a `distribution`:

In [1]: lp.load('ubuntu-docker-images')
Out[1]: <project at https://api.launchpad.net/devel/ubuntu-docker-images>

I think it's probably a mistake that `searchOCIProject` doesn't exist on projects. Project-based OCI projects (sorry about the confusing terminology) were added a bit later than distribution-based OCI projects, and this was probably an oversight while doing that work. Please use "Create bug report" on this question to convert it into a bug report.

Can you help with this problem?

Provide an answer of your own, or ask Tomáš Virtus for more information if necessary.

To post a message you must log in.