Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7876581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:11:22+00:00 2026-06-03T03:11:22+00:00

Hello guys in my code i’m getting this stack: Traceback (most recent call last):

  • 0

Hello guys in my code i’m getting this stack:

Traceback (most recent call last):
  File "main.py", line 30, in <module>
    print nova.put_server_metadata("48f366bd-e9c9-47b5-a41f-ca9bcac2d945","labeltest","2.0")
TypeError: 'str' object is not callable

but i’ve no idea, about this error, i’ve tried to put a print inside my method “put_server_metadata”, but it’s not printing on screen, follow the code:

Main class:

import novaapiclient
import novaauth

if __name__ == "__main__":

    nova = novaapiclient.NovaAPIClient("http://192.168.100.142:35357/v2.0/tokens")

    nova.makeAuth("adminUser", "secretword", "2ad1fc162c254e59bea043560b7f73cb")

    print nova.put_server_metadata("48f366bd-e9c9-47b5-a41f-ca9bcac2d945","labeltest","2.0")

And my put_server_metadata code:

def put_server_metadata(self, serv_id, label, version):
        if self.auth.isAuthed():

            c = pycurl.Curl()
            printer = cStringIO.StringIO()

            url = self.auth.getComputeURL() + "/servers/%s/metadata" % serv_id
            json_put = file('json_server_put_metadata.json','r+w')
            new_js = str(self.put_server_metadata) % (label, version)

            json_put.seek(0)
            json_put.write(new_js)
            json_put.truncate()
            json_put.close()

            json_to_send = file('json_server_put_metadata.json','r+w')
            siz = os.path.getsize("json_server_put_metadata.json")

            tok = str(self.auth.getAuthToken())

            final_tok = "X-Auth-Token: %s" % tok
            content_len = "Content-length: %d" % siz
            cont_type = "Content-Type: application/json"
            accept = "Accept: application/json"

            c.setopt(pycurl.URL, url)
            c.setopt(pycurl.PUT, 1)
            c.setopt(pycurl.HTTPHEADER, [final_tok, cont_type, accept, content_len])
            c.setopt(pycurl.INFILE, json_to_send)
            c.setopt(pycurl.INFILESIZE, siz)
            c.setopt(pycurl.WRITEFUNCTION, printer.write)
            c.setopt(pycurl.VERBOSE, 1)
            c.perform()
            c.close()

            return printer.getvalue()
        else:
            return "Not authorized"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:11:22+00:00Added an answer on June 3, 2026 at 3:11 am

    From the error message, it would appear that put_server_metadata is used both as a method and as a string. The following hints at the same:

    def put_server_metadata(self, serv_id, label, version):  # a method
      ...
      new_js = str(self.put_server_metadata) % ... # not consistent with
                                                   # put_server_metadata being a method
    

    If were you, I’d search through the code for all occurrences of put_server_metadata and would take it from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello guys I have this code in main.php config file: 'components' => array( '[.........]',
Hello guys i have a little problem i get an error: File C:\Users\kokki\Desktop\gb1\main.py, line
Hello guys Im using advance notification manager this is the code Notification note =
Hello guys I have 1675 line Code. Want to when user click button textbox.text
I have this code: $abc = ' Hello Guys , Goodmorning'; I want to
Hello guys im getting This error please see the attachment >> Index and count
Hello guys this method sending file on client machine private void StartServer() { TcpListener
Hello guys look to my code I'm trying to make a program which asks
* Hello Guys..! * Normally a java program needs main() function to execute the
Hello Guys I've a request for you.I've Drinks, Menus and Users routes. I've this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.