Skip to content

Commit

Permalink
add VM create time in tag
Browse files Browse the repository at this point in the history
  • Loading branch information
1injex committed Aug 27, 2021
1 parent 7e61348 commit af920db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions azure/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager, UserMixin, login_user, login_required, logout_user, current_user
from werkzeug.security import generate_password_hash, check_password_hash
import time
import function
import os
import click
Expand Down Expand Up @@ -183,6 +184,8 @@ def create_vm(credential_id):
tenant_id = credential.tenant_id
subscription_id = credential.subscription_id
tag = request.form.get('tag')
createtime = time.strftime('%m%d-%H%M', time.localtime(time.time()))
tag = (tag + "-" + createtime)
location = request.form.get('location')
size = request.form.get('size')
os = request.form.get('os')
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ MarkupSafe==2.0.1
requests==2.25.1
SQLAlchemy==1.4.20
urllib3==1.26.6
Werkzeug==2.0.1
Werkzeug==2.0.1

0 comments on commit af920db

Please sign in to comment.